]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: fix cases of copy instead of move, as reported by coverity 14259/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 29 May 2024 08:07:18 +0000 (10:07 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 29 May 2024 08:07:18 +0000 (10:07 +0200)
pdns/recursordist/rec-main.cc
pdns/recursordist/rec_channel_rec.cc
pdns/recursordist/settings/cxxsupport.cc

index 5784e63db378481d7e9d6cec4f68a64b8712cd0c..044aeca9cb3ce78869049eab496ef2e80b29b104 100644 (file)
@@ -3193,7 +3193,7 @@ int main(int argc, char** argv)
     }
     if (yamlstatus == pdns::settings::rec::YamlSettingsStatus::OK) {
       auto lock = g_yamlStruct.lock();
-      *lock = settings;
+      *lock = std::move(settings);
     }
     if (yamlstatus == pdns::settings::rec::YamlSettingsStatus::CannotOpen) {
       configname += ".conf";
index d86c097640eb8b08bcfc49a1365d860638a56a66..6637bd93eec4c1de521f4ac9127167dfd9712d2d 100644 (file)
@@ -2218,7 +2218,7 @@ RecursorControlChannel::Answer luaconfig(bool broadcast)
     lci = g_luaconfs.getCopy();
     if (broadcast) {
       startLuaConfigDelayedThreads(lci.rpzs, lci.generation);
-      broadcastFunction([=] { return pleaseSupplantProxyMapping(proxyMapping); });
+      broadcastFunction([pmap = std::move(proxyMapping)] { return pleaseSupplantProxyMapping(pmap); });
     }
     else {
       // Initial proxy mapping
index 0edb5472d1a7c85586c8ded3bf27f33a0af6b4f2..dd88d1f06092ba85d9d425218e56b90c8f5adb6c 100644 (file)
@@ -638,7 +638,7 @@ std::string pdns::settings::rec::defaultsToYaml()
     // And for all other values below, the default is either an empty string or an empty vector.
     // Once we get more u64 values below with different default values this hack no longer works.
     rustvalue.u64_val = 24;
-    map.emplace(std::pair{std::pair{section, name}, pdns::rust::settings::rec::OldStyle{section, name, name, type, rustvalue, false}});
+    map.emplace(std::pair{std::pair{section, name}, pdns::rust::settings::rec::OldStyle{section, name, name, type, std::move(rustvalue), false}});
   };
   def("dnssec", "trustanchors", "Vec<TrustAnchor>");
   def("dnssec", "negative_trustanchors", "Vec<NegativeTrustAnchor>");