diff --git a/third_party/nix/src/libexpr/get-drvs.cc b/third_party/nix/src/libexpr/get-drvs.cc index d21e8ba89..33bded2fa 100644 --- a/third_party/nix/src/libexpr/get-drvs.cc +++ b/third_party/nix/src/libexpr/get-drvs.cc @@ -292,9 +292,8 @@ bool DrvInfo::queryMetaBool(const std::string& name, bool def) { } void DrvInfo::setMeta(const std::string& name, Value* v) { - getMeta(); - Bindings* old = meta; - meta = Bindings::NewGC(old->size()); + Bindings* old = getMeta(); + meta = Bindings::NewGC(old->size() + 1); Symbol sym = state->symbols.Create(name); if (old != nullptr) { for (auto i : *old) {