]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Prevent a copy of the UUID when scanning rules for removal
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 14 Nov 2023 14:38:14 +0000 (15:38 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 14 Nov 2023 14:38:14 +0000 (15:38 +0100)
pdns/dnsdist-lua-rules.cc

index 63beb7220c768d421df722b65072e95ec2e8dad7..37f04218cc6643f56c6d0fe06a519a6cddbaff2d 100644 (file)
@@ -133,7 +133,7 @@ static void rmRule(GlobalStateHolder<vector<T> > *someRuleActions, const boost::
       const auto uuid = getUniqueID(*str);
       auto removeIt = std::remove_if(rules.begin(),
                                      rules.end(),
-                                     [uuid](const T& rule) { return rule.d_id == uuid; });
+                                     [&uuid](const T& rule) { return rule.d_id == uuid; });
       if (removeIt == rules.end()) {
         g_outputBuffer = "Error: no rule matched\n";
         return;