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:
Nikolay Sivov 2017-07-09 17:00:39 +03:00 committed by Alexandre Julliard
parent 689268d2f2
commit f55a116101
1 changed files with 1 additions and 1 deletions

View File

@ -4133,12 +4133,12 @@ static DWORD HTTP_HandleRedirect(http_request_t *request, WCHAR *url)
request->path = heap_alloc(needed*sizeof(WCHAR));
rc = UrlEscapeW(path, request->path, &needed,
URL_ESCAPE_SPACES_ONLY);
heap_free(path);
if (rc != S_OK)
{
ERR("Unable to escape string!(%s) (%d)\n",debugstr_w(path),rc);
strcpyW(request->path, path);
}
heap_free(path);
}
/* Remove custom content-type/length headers on redirects. */