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