[NSLOOKUP] fix resource leaks CID 701325

svn path=/trunk/; revision=68977
This commit is contained in:
Christoph von Wittich 2015-09-04 07:48:18 +00:00
parent 2758598c82
commit 7e866d72cd

View file

@ -33,6 +33,9 @@ BOOL SendRequest( PCHAR pInBuffer,
/* 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;
RecAddr.sin_port = htons( State.port );
@ -130,6 +133,7 @@ BOOL SendRequest( PCHAR pInBuffer,
_tprintf( _T("sendto() failed with unknown error\n") );
}
closesocket( s );
return FALSE;
}
@ -221,6 +225,7 @@ BOOL SendRequest( PCHAR pInBuffer,
_tprintf( _T("recvfrom() failed with unknown error\n") );
}
closesocket( s );
return FALSE;
}