server: Avoid leaking "acceptsock" on allocation failure.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-01-21 18:16:42 -06:00 committed by Alexandre Julliard
parent 4782f67bca
commit fe11ff87ac
1 changed files with 5 additions and 1 deletions

View File

@ -1473,7 +1473,11 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
return 0; return 0;
} }
if (!(req = alloc_accept_req( acceptsock, async, params ))) return 0; if (!(req = alloc_accept_req( acceptsock, async, params )))
{
release_object( acceptsock );
return 0;
}
list_add_tail( &sock->accept_list, &req->entry ); list_add_tail( &sock->accept_list, &req->entry );
acceptsock->accept_recv_req = req; acceptsock->accept_recv_req = req;
release_object( acceptsock ); release_object( acceptsock );