]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix CodeQL: move code up to avoid usage after std::move 15439/head
authorOliver Chen <oliver.chen@nokia-sbell.com>
Wed, 16 Apr 2025 06:17:26 +0000 (06:17 +0000)
committerOliver Chen <oliver.chen@nokia-sbell.com>
Wed, 16 Apr 2025 06:17:26 +0000 (06:17 +0000)
pdns/dnsdistdist/dnsdist-configuration-yaml.cc

index 475a75660c61b3b45c66f57a245aa88690d9fd6d..be82deb681198187f2b9d4318f6b21c5a704589e 100644 (file)
@@ -487,6 +487,8 @@ static std::shared_ptr<DownstreamState> createBackendFromConfiguration(const dns
     tlsCtx = getTLSContext(backendConfig.d_tlsParams);
   }
 
+  backendConfig.dscp = config.dscp;
+
   auto downstream = std::make_shared<DownstreamState>(std::move(backendConfig), std::move(tlsCtx), !configCheck);
 
 #if defined(HAVE_XSK)
@@ -507,8 +509,6 @@ static std::shared_ptr<DownstreamState> createBackendFromConfiguration(const dns
     dnsdist::ServiceDiscovery::addUpgradeableServer(downstream, autoUpgradeConf.interval, std::string(autoUpgradeConf.pool), autoUpgradeConf.doh_key, autoUpgradeConf.keep);
   }
 
-  backendConfig.dscp = config.dscp;
-
   return downstream;
 }