Skip to content

Commit

Permalink
nixd/Eval: avoid potential dangling reference in AttrSetProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
inclyc committed Apr 17, 2024
1 parent d4cef26 commit 1fc11ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nixd/lib/Eval/AttrSetProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ void AttrSetProvider::onOptionComplete(
for (const auto *AttrPtr :
Scope.attrs->lexicographicOrder(state().symbols)) {
const nix::Attr &Attr = *AttrPtr;
const std::string &Name = state().symbols[Attr.name];
std::string Name = state().symbols[Attr.name];
if (Name.starts_with(Params.Prefix)) {
// Add a new "OptionField", see it's type.
assert(Attr.value);
Expand Down

0 comments on commit 1fc11ae

Please sign in to comment.