Author: cwittich
Date: Fri Sep 4 07:48:18 2015
New Revision: 68977
URL:
http://svn.reactos.org/svn/reactos?rev=68977&view=rev
Log:
[NSLOOKUP] fix resource leaks CID 701325
Modified:
trunk/reactos/base/applications/network/nslookup/utility.c
Modified: trunk/reactos/base/applications/network/nslookup/utility.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/nslookup/utility.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/nslookup/utility.c [iso-8859-1] Fri Sep 4
07:48:18 2015
@@ -32,6 +32,9 @@
/* Create the sockets for both send and receive. */
s = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
+
+ if (s == INVALID_SOCKET)
+ return FALSE;
/* Set up the structure to tell it where we are going. */
RecAddr.sin_family = AF_INET;
@@ -130,6 +133,7 @@
_tprintf( _T("sendto() failed with unknown error\n") );
}
+ closesocket( s );
return FALSE;
}
@@ -221,6 +225,7 @@
_tprintf( _T("recvfrom() failed with unknown error\n") );
}
+ closesocket( s );
return FALSE;
}