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: dnsdist-1.8.3~7^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8eff67b4ed680f1303a659ecd0355071b1448e63;p=thirdparty%2Fpdns.git dnsdist: Prevent a copy of the UUID when scanning rules for removal (cherry picked from commit aa7c1fcdd0500aa349659aa7a33cae960e45f093) --- diff --git a/pdns/dnsdist-lua-rules.cc b/pdns/dnsdist-lua-rules.cc index be899d6f62..da309e5220 100644 --- a/pdns/dnsdist-lua-rules.cc +++ b/pdns/dnsdist-lua-rules.cc @@ -132,7 +132,7 @@ static void rmRule(GlobalStateHolder > *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;