Skip to content

Commit

Permalink
[MSAFD] WSPRecvFrom: 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 6a52207 commit 2441d8f
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 @@ -510,6 +510,7 @@ WSPRecvFrom(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, lpNumberOfBytesRead);
}
if (lpCompletionRoutine == NULL)
Expand All @@ -527,6 +528,7 @@ WSPRecvFrom(SOCKET Handle,
if (!APCContext)
{
ERR("Not enough memory for APC Context\n");
NtClose(SockEvent);
return MsafdReturnWithErrno(STATUS_INSUFFICIENT_RESOURCES, lpErrno, 0, lpNumberOfBytesRead);
}
APCContext->lpCompletionRoutine = lpCompletionRoutine;
Expand Down

0 comments on commit 2441d8f

Please sign in to comment.