From: Remi Gacogne Date: Tue, 21 Nov 2023 07:41:45 +0000 (+0100) Subject: dnsdist: Fix another 'auto causes a copy' warning from Coverity X-Git-Tag: rec-5.0.0-rc1~3^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3085c01e45bf202b3a22c1e022ad665452ae8f07;p=thirdparty%2Fpdns.git dnsdist: Fix another 'auto causes a copy' warning from Coverity --- diff --git a/pdns/dnsdist-lua-bindings.cc b/pdns/dnsdist-lua-bindings.cc index e6a821b31f..bb930cc746 100644 --- a/pdns/dnsdist-lua-bindings.cc +++ b/pdns/dnsdist-lua-bindings.cc @@ -310,7 +310,7 @@ void setupLuaBindings(LuaContext& luaCtx, bool client) }); luaCtx.registerFunction, LuaArray> &name)>("remove", [](SuffixMatchNode &smn, const boost::variant, LuaArray> &name) { if (name.type() == typeid(DNSName)) { - auto actualName = boost::get(name); + const auto& actualName = boost::get(name); smn.remove(actualName); return; } @@ -321,14 +321,14 @@ void setupLuaBindings(LuaContext& luaCtx, bool client) return; } if (name.type() == typeid(LuaArray)) { - auto names = boost::get>(name); + const auto& names = boost::get>(name); for (const auto& actualName : names) { smn.remove(actualName.second); } return; } if (name.type() == typeid(LuaArray)) { - auto names = boost::get>(name); + const auto& names = boost::get>(name); for (const auto& actualName : names) { DNSName dnsName(actualName.second); smn.remove(dnsName); diff --git a/pdns/dnsdistdist/dnsdist-tcp-downstream.cc b/pdns/dnsdistdist/dnsdist-tcp-downstream.cc index 930814854a..684c46fcee 100644 --- a/pdns/dnsdistdist/dnsdist-tcp-downstream.cc +++ b/pdns/dnsdistdist/dnsdist-tcp-downstream.cc @@ -815,7 +815,7 @@ bool TCPConnectionToBackend::isXFRFinished(const TCPResponse& response, TCPQuery if (!unknownContent) { continue; } - auto raw = unknownContent->getRawContent(); + const auto& raw = unknownContent->getRawContent(); auto serial = getSerialFromRawSOAContent(raw); if (query.d_xfrPrimarySerial == 0) { // store the first SOA in our client's connection metadata