[PATCH] wininet: Prevent a double-free.

Pierre Schweitzer <[email protected]> Sun, 10 Jun 2018 12:34:35 +0200
Newsgroups gmane.comp.emulators.wine.patches
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------327B15BF234283B6711B0EC3
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Submitting on behalf of Mark.
-- 
Pierre Schweitzer <pierre at reactos.org>
System & Network Administrator
Senior Kernel Developer
ReactOS Deutschland e.V.

--------------327B15BF234283B6711B0EC3
Content-Type: text/x-patch;
 name="001-wininet-Prevent-a-double-free.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="001-wininet-Prevent-a-double-free.patch"

From 9ea5a0bcc7d27a750f251ab43c58c7a0dba6890c Mon Sep 17 00:00:00 2001
From: Mark Jansen <[email protected]>
Date: Sun, 10 Jun 2018 01:13:30 +0200
Subject: [PATCH] wininet: Prevent a double-free.
 
Signed-off-by: Mark Jansen <[email protected]>
---
dlls/wininet/http.c | 3 +++
 1 file changed, 3 insertions(+)
 
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index f28f7c5fd6..0150da1920 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -5070,6 +5070,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
                     heap_free(new_url);
                     if (res == ERROR_SUCCESS) {
                         heap_free(requestString);
+                        requestString = NULL;
                         loop_next = TRUE;
                     }
                     redirected = TRUE;
@@ -5091,6 +5092,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
                                                  request->session->password, host))
                         {
                             heap_free(requestString);
+                            requestString = NULL;
                             if (drain_content(request, TRUE) != ERROR_SUCCESS)
                             {
                                 FIXME("Could not drain content\n");
@@ -5120,6 +5122,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
                                                  NULL))
                         {
                             heap_free(requestString);
+                            requestString = NULL;
                             if (drain_content(request, TRUE) != ERROR_SUCCESS)
                             {
                                 FIXME("Could not drain content\n");
-- 
2.12.2.windows.1

--------------327B15BF234283B6711B0EC3
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

Cg==

--------------327B15BF234283B6711B0EC3--