mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[MSAFD] Don't leak event while querying/setting socket options
This commit is contained in:
parent
6bc61f63f1
commit
6ee2f9882c
1 changed files with 6 additions and 2 deletions
|
@ -3298,6 +3298,7 @@ GetSocketInformation(PSOCKET_INFORMATION Socket,
|
|||
if ((Socket->SharedData->CreateFlags & SO_SYNCHRONOUS_NONALERT) != 0)
|
||||
{
|
||||
TRACE("Opened without flag WSA_FLAG_OVERLAPPED. Do nothing.\n");
|
||||
NtClose( SockEvent );
|
||||
return 0;
|
||||
}
|
||||
if (CompletionRoutine == NULL)
|
||||
|
@ -3315,6 +3316,7 @@ GetSocketInformation(PSOCKET_INFORMATION Socket,
|
|||
if (!APCContext)
|
||||
{
|
||||
ERR("Not enough memory for APC Context\n");
|
||||
NtClose( SockEvent );
|
||||
return WSAEFAULT;
|
||||
}
|
||||
APCContext->lpCompletionRoutine = CompletionRoutine;
|
||||
|
@ -3346,6 +3348,8 @@ GetSocketInformation(PSOCKET_INFORMATION Socket,
|
|||
Status = IOSB->Status;
|
||||
}
|
||||
|
||||
NtClose( SockEvent );
|
||||
|
||||
TRACE("Status %x Information %d\n", Status, IOSB->Information);
|
||||
|
||||
if (Status == STATUS_PENDING)
|
||||
|
@ -3371,8 +3375,6 @@ GetSocketInformation(PSOCKET_INFORMATION Socket,
|
|||
*Boolean = InfoData.Information.Boolean;
|
||||
}
|
||||
|
||||
NtClose( SockEvent );
|
||||
|
||||
return NO_ERROR;
|
||||
|
||||
}
|
||||
|
@ -3437,6 +3439,7 @@ SetSocketInformation(PSOCKET_INFORMATION Socket,
|
|||
if ((Socket->SharedData->CreateFlags & SO_SYNCHRONOUS_NONALERT) != 0)
|
||||
{
|
||||
TRACE("Opened without flag WSA_FLAG_OVERLAPPED. Do nothing.\n");
|
||||
NtClose( SockEvent );
|
||||
return 0;
|
||||
}
|
||||
if (CompletionRoutine == NULL)
|
||||
|
@ -3454,6 +3457,7 @@ SetSocketInformation(PSOCKET_INFORMATION Socket,
|
|||
if (!APCContext)
|
||||
{
|
||||
ERR("Not enough memory for APC Context\n");
|
||||
NtClose( SockEvent );
|
||||
return WSAEFAULT;
|
||||
}
|
||||
APCContext->lpCompletionRoutine = CompletionRoutine;
|
||||
|
|
Loading…
Reference in a new issue