wininet: Fix potential use-after-free (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
689268d2f2
commit
f55a116101
@ -4133,12 +4133,12 @@ static DWORD HTTP_HandleRedirect(http_request_t *request, WCHAR *url)
|
|||||||
request->path = heap_alloc(needed*sizeof(WCHAR));
|
request->path = heap_alloc(needed*sizeof(WCHAR));
|
||||||
rc = UrlEscapeW(path, request->path, &needed,
|
rc = UrlEscapeW(path, request->path, &needed,
|
||||||
URL_ESCAPE_SPACES_ONLY);
|
URL_ESCAPE_SPACES_ONLY);
|
||||||
heap_free(path);
|
|
||||||
if (rc != S_OK)
|
if (rc != S_OK)
|
||||||
{
|
{
|
||||||
ERR("Unable to escape string!(%s) (%d)\n",debugstr_w(path),rc);
|
ERR("Unable to escape string!(%s) (%d)\n",debugstr_w(path),rc);
|
||||||
strcpyW(request->path, path);
|
strcpyW(request->path, path);
|
||||||
}
|
}
|
||||||
|
heap_free(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove custom content-type/length headers on redirects. */
|
/* Remove custom content-type/length headers on redirects. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user