]> granicus.if.org Git - pdns/commitdiff
auth: Close the TCP connection descriptor if `pthread_create()` failed
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 4 Jul 2016 15:00:15 +0000 (17:00 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 4 Jul 2016 15:00:15 +0000 (17:00 +0200)
pdns/tcpreceiver.cc

index 4e52eadb08f28cfe8456b21e6849e39bffbd2a78..416db2bc1c4f9b7385075c1d8e9f4f58747eedb6 100644 (file)
@@ -1299,6 +1299,7 @@ void TCPNameserver::thread()
             if(pthread_create(&tid, 0, &doConnection, reinterpret_cast<void*>(fd))) {
               L<<Logger::Error<<"Error creating thread: "<<stringerror()<<endl;
               d_connectionroom_sem->post();
+              close(fd);
             }
           }
         }