Commit 2621e98d authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

winhttp: Clean up properly in request_send.

parent 97ba7aa5
...@@ -2925,14 +2925,18 @@ static HRESULT request_send( struct winhttp_request *request ) ...@@ -2925,14 +2925,18 @@ static HRESULT request_send( struct winhttp_request *request )
if (!(ret = WinHttpSendRequest( request->hrequest, NULL, 0, ptr, size, size, 0 ))) if (!(ret = WinHttpSendRequest( request->hrequest, NULL, 0, ptr, size, size, 0 )))
{ {
err = get_last_error(); err = get_last_error();
goto error;
} }
if (!sa) heap_free( ptr ); if ((err = wait_for_completion( request ))) goto error;
else if ((hr = SafeArrayUnaccessData( sa )) != S_OK) return hr; if (sa) SafeArrayUnaccessData( sa );
if (!ret) return HRESULT_FROM_WIN32( err ); else heap_free( ptr );
if ((err = wait_for_completion( request ))) return HRESULT_FROM_WIN32( err );
request->state = REQUEST_STATE_SENT; request->state = REQUEST_STATE_SENT;
return S_OK; return S_OK;
error:
if (sa) SafeArrayUnaccessData( sa );
else heap_free( ptr );
return HRESULT_FROM_WIN32( err );
} }
static HRESULT request_send_and_receive( struct winhttp_request *request ) static HRESULT request_send_and_receive( struct winhttp_request *request )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment