Nikolay Sivov : wininet: Fix potential use-after-free (Coverity).
Alexandre Julliard
julliard at winehq.org
Mon Jul 10 15:52:47 CDT 2017
Module: wine
Branch: master
Commit: f55a116101836a19f017ba42a1a99fc17a5f08c0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f55a116101836a19f017ba42a1a99fc17a5f08c0
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sun Jul 9 17:00:39 2017 +0300
wininet: Fix potential use-after-free (Coverity).
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wininet/http.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index ef9f144..078a5cb 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -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. */
More information about the wine-cvs
mailing list