]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: free the url before storing a new copy
authorDaniel Stenberg <daniel@haxx.se>
Tue, 9 May 2023 06:31:11 +0000 (08:31 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 9 May 2023 07:47:30 +0000 (09:47 +0200)
To avoid a memory-leak.

Reported-by: Hiroki Kurosawa
Closes #11093

lib/http.c

index bffdd3468536d6ba9a6f531677e6cedd417894e3..15cf22c5e18ba382d75fd5007f859fecec8bf67b 100644 (file)
@@ -1010,7 +1010,7 @@ CURLcode Curl_http_input_auth(struct Curl_easy *data, bool proxy,
         if(authp->picked == CURLAUTH_NEGOTIATE) {
           CURLcode result = Curl_input_negotiate(data, conn, proxy, auth);
           if(!result) {
-            DEBUGASSERT(!data->req.newurl);
+            free(data->req.newurl);
             data->req.newurl = strdup(data->state.url);
             if(!data->req.newurl)
               return CURLE_OUT_OF_MEMORY;