mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
[NSLOOKUP] fix resource leaks CID 701325
svn path=/trunk/; revision=68977
This commit is contained in:
parent
2758598c82
commit
7e866d72cd
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue