winhttp: Fix a couple of memory leaks (valgrind).

This commit is contained in:
Hans Leidekker 2014-05-13 13:43:11 +02:00 committed by Alexandre Julliard
parent e49ebbe953
commit 6494c50ad7
2 changed files with 3 additions and 1 deletions

View File

@ -488,6 +488,7 @@ BOOL netconn_secure_connect( netconn_t *conn, WCHAR *hostname )
} }
} }
heap_free(read_buf);
if(status != SEC_E_OK || res != ERROR_SUCCESS) { if(status != SEC_E_OK || res != ERROR_SUCCESS) {
WARN("Failed to initialize security context failed: %08x\n", status); WARN("Failed to initialize security context failed: %08x\n", status);

View File

@ -2250,6 +2250,8 @@ static BOOL handle_redirect( request_t *request, DWORD status )
request->read_chunked = FALSE; request->read_chunked = FALSE;
request->read_chunked_eof = FALSE; request->read_chunked_eof = FALSE;
} }
else heap_free( hostname );
if (!(ret = add_host_header( request, WINHTTP_ADDREQ_FLAG_REPLACE ))) goto end; if (!(ret = add_host_header( request, WINHTTP_ADDREQ_FLAG_REPLACE ))) goto end;
if (!(ret = open_connection( request ))) goto end; if (!(ret = open_connection( request ))) goto end;
@ -2278,7 +2280,6 @@ static BOOL handle_redirect( request_t *request, DWORD status )
ret = TRUE; ret = TRUE;
end: end:
if (!ret) heap_free( hostname );
heap_free( location ); heap_free( location );
return ret; return ret;
} }