winhttp: Don't crash setting up secure proxy.

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Andrew Eikum 2019-03-08 11:52:01 -06:00 committed by Alexandre Julliard
parent 344bd3b1cc
commit e87f2c399d
1 changed files with 5 additions and 1 deletions

View File

@ -1673,6 +1673,9 @@ static BOOL open_connection( struct request *request )
}
netconn_set_timeout( netconn, TRUE, request->send_timeout );
netconn_set_timeout( netconn, FALSE, request->receive_response_timeout );
request->netconn = netconn;
if (is_secure)
{
if (connect->session->proxy_server &&
@ -1680,6 +1683,7 @@ static BOOL open_connection( struct request *request )
{
if (!secure_proxy_connect( request ))
{
request->netconn = NULL;
heap_free( addressW );
netconn_close( netconn );
return FALSE;
@ -1693,13 +1697,13 @@ static BOOL open_connection( struct request *request )
!netconn_secure_connect( netconn, connect->hostname, request->security_flags,
&request->cred_handle, request->check_revocation ))
{
request->netconn = NULL;
heap_free( addressW );
netconn_close( netconn );
return FALSE;
}
}
request->netconn = netconn;
send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, addressW, strlenW(addressW) + 1 );
}
else