From: Mark Zealey Date: Mon, 13 Jan 2014 09:36:50 +0000 (+0200) Subject: close socket if bind fails to fix coverity leak issues X-Git-Tag: rec-3.6.0-rc1~246^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c896042b978781b9a2f499825c693a43f6ee7b3;p=pdns close socket if bind fails to fix coverity leak issues --- diff --git a/pdns/nameserver.cc b/pdns/nameserver.cc index 04d902701..1be9663eb 100644 --- a/pdns/nameserver.cc +++ b/pdns/nameserver.cc @@ -128,6 +128,7 @@ void UDPNameserver::bindIPv4() g_localaddresses.push_back(locala); if(::bind(s, (sockaddr*)&locala, locala.getSocklen()) < 0) { + close(s); if( errno == EADDRNOTAVAIL && ! ::arg().mustDo("local-address-nonexist-fail") ) { L<