]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Properly close the cross-connections pipes in case of error
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 19 Jul 2021 16:06:05 +0000 (18:06 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 13 Sep 2021 13:28:27 +0000 (15:28 +0200)
pdns/dnsdist-tcp.cc

index 7673eaacc6970f268f55b303d73f86d5014e4ba7..4e0fdec163c05c7ffe32e871704fc6eff9b9e7b8 100644 (file)
@@ -178,6 +178,8 @@ void TCPClientCollection::addTCPClientThread()
 
     if (d_numthreads >= d_tcpclientthreads.size()) {
       vinfolog("Adding a new TCP client thread would exceed the vector size (%d/%d), skipping. Consider increasing the maximum amount of TCP client threads with setMaxTCPClientThreads() in the configuration.", d_numthreads.load(), d_tcpclientthreads.size());
+      close(crossProtocolFDs[0]);
+      close(crossProtocolFDs[1]);
       close(pipefds[0]);
       close(pipefds[1]);
       return;