Commit 6f44627b authored by Nigel Liang's avatar Nigel Liang Committed by Alexandre Julliard

wininet: Release object in HttpSendRequestExW before return on error.

parent 73e2ff59
...@@ -2121,7 +2121,7 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest, ...@@ -2121,7 +2121,7 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest,
LPINTERNET_BUFFERSW lpBuffersOut, LPINTERNET_BUFFERSW lpBuffersOut,
DWORD dwFlags, DWORD_PTR dwContext) DWORD dwFlags, DWORD_PTR dwContext)
{ {
BOOL ret; BOOL ret = FALSE;
LPWININETHTTPREQW lpwhr; LPWININETHTTPREQW lpwhr;
LPWININETHTTPSESSIONW lpwhs; LPWININETHTTPSESSIONW lpwhs;
LPWININETAPPINFOW hIC; LPWININETAPPINFOW hIC;
...@@ -2134,7 +2134,7 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest, ...@@ -2134,7 +2134,7 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest,
if (NULL == lpwhr || lpwhr->hdr.htype != WH_HHTTPREQ) if (NULL == lpwhr || lpwhr->hdr.htype != WH_HHTTPREQ)
{ {
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
return FALSE; goto lend;
} }
lpwhs = lpwhr->lpHttpSession; lpwhs = lpwhr->lpHttpSession;
...@@ -2178,7 +2178,6 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest, ...@@ -2178,7 +2178,6 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest,
* This is from windows. * This is from windows.
*/ */
INTERNET_SetLastError(ERROR_IO_PENDING); INTERNET_SetLastError(ERROR_IO_PENDING);
ret = FALSE;
} }
else else
{ {
...@@ -2190,7 +2189,10 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest, ...@@ -2190,7 +2189,10 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest,
ret = HTTP_HttpSendRequestW(lpwhr, NULL, 0, NULL, 0, 0, FALSE); ret = HTTP_HttpSendRequestW(lpwhr, NULL, 0, NULL, 0, 0, FALSE);
} }
WININET_Release(&lpwhr->hdr); lend:
if ( lpwhr )
WININET_Release( &lpwhr->hdr );
TRACE("<---\n"); TRACE("<---\n");
return ret; return ret;
} }
......
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