Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- server/sock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/server/sock.c b/server/sock.c index 396447a0aa4..9cc634d3771 100644 --- a/server/sock.c +++ b/server/sock.c @@ -2290,9 +2290,6 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) if (!send_len) return; }
- if (!(req = mem_alloc( sizeof(*req) ))) - return; - sock->state = SOCK_CONNECTING;
if (params->synchronous && sock->nonblocking) @@ -2302,6 +2299,9 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) return; }
+ if (!(req = mem_alloc( sizeof(*req) ))) + return; + req->async = (struct async *)grab_object( async ); req->iosb = async_get_iosb( async ); req->sock = (struct sock *)grab_object( sock );
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- server/sock.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/server/sock.c b/server/sock.c index 9cc634d3771..42f73e52fa2 100644 --- a/server/sock.c +++ b/server/sock.c @@ -796,6 +796,7 @@ static void free_poll_req( void *private ) release_object( req->async ); release_object( req->iosb ); list_remove( &req->entry ); + free( req->output ); free( req ); }
@@ -850,6 +851,7 @@ static void complete_async_poll( struct poll_req *req, unsigned int status )
/* pass 0 as result; client will set actual result size */ async_request_complete( req->async, status, 0, req->count * sizeof(*req->output), req->output ); + req->output = NULL; }
static void complete_async_polls( struct sock *sock, int event, int error )
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- 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; }