From 8cc2c57d55050d9483ad1844210a3a29a3c1dfe9 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 23 Feb 2022 09:59:23 +0100 Subject: [PATCH] dnsdist: Fix a 'use after move' in newServer() Reported by Coverity (CID 376518). --- pdns/dnsdist-lua.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index 23f549e13d..d478300ab2 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -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(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) { -- 2.47.3