Author: cgutman
Date: Fri Mar 27 06:21:21 2009
New Revision: 40258
URL:
http://svn.reactos.org/svn/reactos?rev=40258&view=rev
Log:
- Fix several handle leaks
Modified:
trunk/reactos/dll/win32/msafd/misc/dllmain.c
Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/dllma…
==============================================================================
--- trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] Fri Mar 27 06:21:21 2009
@@ -402,6 +402,7 @@
/* If a Close is already in Process, give up */
if (Socket->SharedData.State == SocketClosed)
{
+ NtClose(SockEvent);
*lpErrno = WSAENOTSOCK;
return SOCKET_ERROR;
}
@@ -447,6 +448,7 @@
*/
if (Socket->SharedData.NonBlocking)
{
+ NtClose(SockEvent);
Socket->SharedData.State = OldState;
*lpErrno = WSAEWOULDBLOCK;
return SOCKET_ERROR;
@@ -504,6 +506,7 @@
/* Close the handle */
NtClose((HANDLE)Handle);
+ NtClose(SockEvent);
return NO_ERROR;
}
@@ -951,7 +954,10 @@
WSPSelect(0, &ReadSet, NULL, NULL, &Timeout, NULL);
if (ReadSet.fd_array[0] != Socket->Handle)
+ {
+ NtClose(SockEvent);
return 0;
+ }
/* Send IOCTL */
Status = NtDeviceIoControlFile((HANDLE)Socket->Handle,
@@ -1199,6 +1205,7 @@
if (!NT_SUCCESS(Status))
{
+ NtClose(SockEvent);
WSPCloseSocket( AcceptSocket, lpErrno );
MsafdReturnWithErrno( Status, lpErrno, 0, NULL );
return INVALID_SOCKET;