From: Remi Gacogne Date: Tue, 14 Nov 2023 14:38:14 +0000 (+0100) Subject: dnsdist: Prevent a copy of the UUID when scanning rules for removal X-Git-Tag: rec-5.0.0-rc1~41^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aa7c1fcdd0500aa349659aa7a33cae960e45f093;p=thirdparty%2Fpdns.git dnsdist: Prevent a copy of the UUID when scanning rules for removal --- diff --git a/pdns/dnsdist-lua-rules.cc b/pdns/dnsdist-lua-rules.cc index 63beb7220c..37f04218cc 100644 --- a/pdns/dnsdist-lua-rules.cc +++ b/pdns/dnsdist-lua-rules.cc @@ -133,7 +133,7 @@ static void rmRule(GlobalStateHolder > *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;