Nikolay Sivov : winhttp: Avoid returning while holding a lock (Coverity).

Alexandre Julliard julliard at winehq.org
Tue Aug 8 07:36:38 CDT 2017


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Jul 24 15:41:01 2017 +0300

winhttp: Avoid returning while holding a lock (Coverity).

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winhttp/request.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index f71b17e..b72d2c1 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -1121,19 +1121,21 @@ static BOOL open_connection( request_t *request )
 
     if (!host)
     {
-        if (!(host = heap_alloc( sizeof(*host) ))) return FALSE;
-        host->ref = 1;
-        host->secure = is_secure;
-        host->port = port;
-        list_init( &host->connections );
-        if ((host->hostname = strdupW( connect->servername )))
+        if ((host = heap_alloc( sizeof(*host) )))
         {
-            list_add_head( &connection_pool, &host->entry );
-        }
-        else
-        {
-            heap_free( host );
-            host = NULL;
+            host->ref = 1;
+            host->secure = is_secure;
+            host->port = port;
+            list_init( &host->connections );
+            if ((host->hostname = strdupW( connect->servername )))
+            {
+                list_add_head( &connection_pool, &host->entry );
+            }
+            else
+            {
+                heap_free( host );
+                host = NULL;
+            }
         }
     }
 




More information about the wine-cvs mailing list