From c19f465a65d46c14959df3e9119efc3d7e73dbe7 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 23 Jan 2024 08:51:45 +0100 Subject: [PATCH] dnsdist: Move the console socket instead of copying it Reported by Coverity as CID 414105. We don't really care about the performance impact but other tools are "helpfully" reporting this kind of missed optimizations, so let's not waste our time. --- 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 09574e1df5..54b7109b19 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -1116,7 +1116,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) auto sock = std::make_shared(local.sin4.sin_family, SOCK_STREAM, 0); sock->bind(local, true); sock->listen(5); - auto launch = [sock, local]() { + auto launch = [sock = std::move(sock), local]() { std::thread consoleControlThread(controlThread, sock, local); consoleControlThread.detach(); }; -- 2.47.2