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

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-07-24 15:41:01 +03:00 committed by Alexandre Julliard
parent 3ca2dfe462
commit d0813b7718
1 changed files with 14 additions and 12 deletions

View File

@ -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;
}
}
}