]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix a 'use after move' in newServer()
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 23 Feb 2022 08:59:23 +0000 (09:59 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 23 Feb 2022 08:59:23 +0000 (09:59 +0100)
Reported by Coverity (CID 376518).

pdns/dnsdist-lua.cc

index 23f549e13d3faa8d4555d94b6cbec14f540e99de..d478300ab20fb0201d390d621d5630615c772826 100644 (file)
@@ -642,7 +642,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
                          // create but don't connect the socket in client or check-config modes
                          auto ret = std::make_shared<DownstreamState>(std::move(config), std::move(tlsCtx), !(client || configCheck));
                          if (!(client || configCheck)) {
-                           infolog("Added downstream server %s", config.remote.toStringWithPort());
+                           infolog("Added downstream server %s", ret->d_config.remote.toStringWithPort());
                          }
 
                          if (autoUpgrade) {