]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix another 'auto causes a copy' warning from Coverity
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 21 Nov 2023 07:41:45 +0000 (08:41 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 21 Nov 2023 07:42:51 +0000 (08:42 +0100)
pdns/dnsdist-lua-bindings.cc
pdns/dnsdistdist/dnsdist-tcp-downstream.cc

index e6a821b31f09f392914672f782ddc70b0fad4e15..bb930cc746865ccd654586049398408565e4a857 100644 (file)
@@ -310,7 +310,7 @@ void setupLuaBindings(LuaContext& luaCtx, bool client)
   });
   luaCtx.registerFunction<void (SuffixMatchNode::*)(const boost::variant<DNSName, string, LuaArray<DNSName>, LuaArray<std::string>> &name)>("remove", [](SuffixMatchNode &smn, const boost::variant<DNSName, string, LuaArray<DNSName>, LuaArray<std::string>> &name) {
       if (name.type() == typeid(DNSName)) {
-          auto actualName = boost::get<DNSName>(name);
+          const auto& actualName = boost::get<DNSName>(name);
           smn.remove(actualName);
           return;
       }
@@ -321,14 +321,14 @@ void setupLuaBindings(LuaContext& luaCtx, bool client)
           return;
       }
       if (name.type() == typeid(LuaArray<DNSName>)) {
-          auto names = boost::get<LuaArray<DNSName>>(name);
+          const auto& names = boost::get<LuaArray<DNSName>>(name);
           for (const auto& actualName : names) {
             smn.remove(actualName.second);
           }
           return;
       }
       if (name.type() == typeid(LuaArray<std::string>)) {
-          auto names = boost::get<LuaArray<std::string>>(name);
+          const auto& names = boost::get<LuaArray<std::string>>(name);
           for (const auto& actualName : names) {
             DNSName dnsName(actualName.second);
             smn.remove(dnsName);
index 930814854acc495b7f861004e3a7ff3a828eeaba..684c46fceee1913ff9aeaf004b32366b50805e41 100644 (file)
@@ -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