Zebediah Figura : server: Do not allocate a connect_req structure for nonblocking sockets (Valgrind).

Alexandre Julliard julliard at winehq.org
Fri Oct 8 14:12:25 CDT 2021


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

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Thu Oct  7 23:01:12 2021 -0500

server: Do not allocate a connect_req structure for nonblocking sockets (Valgrind).

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

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

diff --git a/server/sock.c b/server/sock.c
index 7b00cb3f4f4..2b85b2889f0 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -2289,9 +2289,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)
@@ -2301,6 +2298,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 );




More information about the wine-cvs mailing list