Skip to content

Commit

Permalink
[MSAFD] WSPSend: Fix SockEvent leak
Browse files Browse the repository at this point in the history
  • Loading branch information
TAN-Gaming committed Jan 16, 2024
1 parent 2441d8f commit 4bae769
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dll/win32/msafd/misc/sndrcv.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ WSPSend(SOCKET Handle,
if ((Socket->SharedData->CreateFlags & SO_SYNCHRONOUS_NONALERT) != 0)
{
TRACE("Opened without flag WSA_FLAG_OVERLAPPED. Do nothing.\n");
NtClose(SockEvent);
return MsafdReturnWithErrno(STATUS_SUCCESS, lpErrno, 0, lpNumberOfBytesSent);
}
if (lpCompletionRoutine == NULL)
Expand All @@ -710,6 +711,7 @@ WSPSend(SOCKET Handle,
if (!APCContext)
{
ERR("Not enough memory for APC Context\n");
NtClose(SockEvent);
return MsafdReturnWithErrno(STATUS_INSUFFICIENT_RESOURCES, lpErrno, 0, lpNumberOfBytesSent);
}
APCContext->lpCompletionRoutine = lpCompletionRoutine;
Expand Down

0 comments on commit 4bae769

Please sign in to comment.