Zebediah Figura : server: Avoid leaking "acceptsock" on allocation failure.

Alexandre Julliard julliard at winehq.org
Fri Jan 22 15:59:14 CST 2021


Module: wine
Branch: master
Commit: fe11ff87ac8918f5e5104cccccb5544d9c6c30c9
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=fe11ff87ac8918f5e5104cccccb5544d9c6c30c9

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Jan 21 18:16:42 2021 -0600

server: Avoid leaking "acceptsock" on allocation failure.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 server/sock.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/server/sock.c b/server/sock.c
index 5f207e7f180..8c146a0a8f8 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -1473,7 +1473,11 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
             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 );
         acceptsock->accept_recv_req = req;
         release_object( acceptsock );




More information about the wine-cvs mailing list