From 3d521bc7b9b8265b70206471cf5c9e40f791230f Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 7 Oct 2021 23:01:14 -0500 Subject: [PATCH] ws2_32: Close the new socket handle on CF_DEFER. Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/ws2_32/socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 9cbe7908226..b3dab22ae6e 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -3541,6 +3541,7 @@ SOCKET WINAPI WSAAccept( SOCKET s, struct sockaddr *addr, int *addrlen, status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io, IOCTL_AFD_WINE_DEFER, &server_handle, sizeof(server_handle), NULL, 0 ); + closesocket( cs ); SetLastError( status ? RtlNtStatusToDosError( status ) : WSATRY_AGAIN ); return -1; }