]> 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, 12 Dec 2023 10:33:04 +0000 (11:33 +0100)
(cherry picked from commit aa7c1fcdd0500aa349659aa7a33cae960e45f093)

pdns/dnsdist-lua-rules.cc

index be899d6f6235706232ffc9ac3ce250c83e34b403..da309e522010e21b08ba130b6d53ef286c834f59 100644 (file)
@@ -132,7 +132,7 @@ static void rmRule(GlobalStateHolder<vector<T> > *someRuleActions, boost::varian
       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;