]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Move the console socket instead of copying it 13735/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 23 Jan 2024 07:51:45 +0000 (08:51 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 23 Jan 2024 07:51:45 +0000 (08:51 +0100)
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

index 09574e1df5d82f28237e0894c8f32e94a666ca59..54b7109b1968413a0df507e7862c933b61ec66f3 100644 (file)
@@ -1116,7 +1116,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
       auto sock = std::make_shared<Socket>(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();
       };