From: Remi Gacogne Date: Wed, 23 Feb 2022 08:59:23 +0000 (+0100) Subject: dnsdist: Fix a 'use after move' in newServer() X-Git-Tag: rec-4.7.0-alpha1~4^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8cc2c57d55050d9483ad1844210a3a29a3c1dfe9;p=thirdparty%2Fpdns.git dnsdist: Fix a 'use after move' in newServer() Reported by Coverity (CID 376518). --- 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) {