From: Remi Gacogne Date: Mon, 4 Jul 2016 15:00:15 +0000 (+0200) Subject: auth: Close the TCP connection descriptor if `pthread_create()` failed X-Git-Tag: rec-4.0.0~19^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48e8d70b88dcde79589e99583b676f0c293f026c;p=pdns auth: Close the TCP connection descriptor if `pthread_create()` failed --- diff --git a/pdns/tcpreceiver.cc b/pdns/tcpreceiver.cc index 4e52eadb0..416db2bc1 100644 --- a/pdns/tcpreceiver.cc +++ b/pdns/tcpreceiver.cc @@ -1299,6 +1299,7 @@ void TCPNameserver::thread() if(pthread_create(&tid, 0, &doConnection, reinterpret_cast(fd))) { L<post(); + close(fd); } } }