Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/winhttp/request.c | 2 +- dlls/winhttp/session.c | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 08e9d7584e..1324005f1d 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -3106,7 +3106,7 @@ HINTERNET WINAPI WinHttpWebSocketCompleteUpgrade( HINTERNET hrequest, DWORD_PTR addref_object( &request->hdr ); socket->request = request;
- if ((hsocket = alloc_handle( &socket->hdr ))) socket->hdr.handle = hsocket; + hsocket = alloc_handle( &socket->hdr );
release_object( &socket->hdr ); release_object( &request->hdr ); diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 13d228d851..a5ec8b22f3 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -282,8 +282,7 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR agent, DWORD access, LPCWSTR proxy, LPCWST if (bypass && !(session->proxy_bypass = strdupW( bypass ))) goto end; }
- if (!(handle = alloc_handle( &session->hdr ))) goto end; - session->hdr.handle = handle; + handle = alloc_handle( &session->hdr );
end: release_object( &session->hdr ); @@ -559,10 +558,10 @@ HINTERNET WINAPI WinHttpConnect( HINTERNET hsession, LPCWSTR server, INTERNET_PO connect->hostport = port; if (!set_server_for_hostname( connect, server, port )) goto end;
- if (!(hconnect = alloc_handle( &connect->hdr ))) goto end; - connect->hdr.handle = hconnect; - - send_callback( &session->hdr, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, &hconnect, sizeof(hconnect) ); + if ((hconnect = alloc_handle( &connect->hdr ))) + { + send_callback( &session->hdr, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, &hconnect, sizeof(hconnect) ); + }
end: release_object( &connect->hdr ); @@ -1137,10 +1136,10 @@ HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, LPCWSTR verb, LPCWSTR o if (!(request->version = strdupW( version ))) goto end; if (!(add_accept_types_header( request, types ))) goto end;
- if (!(hrequest = alloc_handle( &request->hdr ))) goto end; - request->hdr.handle = hrequest; - - send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, &hrequest, sizeof(hrequest) ); + if ((hrequest = alloc_handle( &request->hdr ))) + { + send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, &hrequest, sizeof(hrequest) ); + }
end: release_object( &request->hdr );