From: Oliver Chen Date: Wed, 16 Apr 2025 06:17:26 +0000 (+0000) Subject: Fix CodeQL: move code up to avoid usage after std::move X-Git-Tag: dnsdist-2.0.0-alpha2~57^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15439%2Fhead;p=thirdparty%2Fpdns.git Fix CodeQL: move code up to avoid usage after std::move --- diff --git a/pdns/dnsdistdist/dnsdist-configuration-yaml.cc b/pdns/dnsdistdist/dnsdist-configuration-yaml.cc index 475a75660c..be82deb681 100644 --- a/pdns/dnsdistdist/dnsdist-configuration-yaml.cc +++ b/pdns/dnsdistdist/dnsdist-configuration-yaml.cc @@ -487,6 +487,8 @@ static std::shared_ptr createBackendFromConfiguration(const dns tlsCtx = getTLSContext(backendConfig.d_tlsParams); } + backendConfig.dscp = config.dscp; + auto downstream = std::make_shared(std::move(backendConfig), std::move(tlsCtx), !configCheck); #if defined(HAVE_XSK) @@ -507,8 +509,6 @@ static std::shared_ptr createBackendFromConfiguration(const dns dnsdist::ServiceDiscovery::addUpgradeableServer(downstream, autoUpgradeConf.interval, std::string(autoUpgradeConf.pool), autoUpgradeConf.doh_key, autoUpgradeConf.keep); } - backendConfig.dscp = config.dscp; - return downstream; }