From a2ce01ecc4fe7d51f965beff26229f22fd2514f2 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 19 Jul 2021 18:06:05 +0200 Subject: [PATCH] dnsdist: Properly close the cross-connections pipes in case of error --- pdns/dnsdist-tcp.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pdns/dnsdist-tcp.cc b/pdns/dnsdist-tcp.cc index 7673eaacc6..4e0fdec163 100644 --- a/pdns/dnsdist-tcp.cc +++ b/pdns/dnsdist-tcp.cc @@ -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; -- 2.47.2