From: Daniel Stenberg Date: Tue, 9 May 2023 06:31:11 +0000 (+0200) Subject: http: free the url before storing a new copy X-Git-Tag: curl-8_1_0~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7170a8f2ed4dc5a4cfb3ef3c002d218c4bcecad;p=thirdparty%2Fcurl.git http: free the url before storing a new copy To avoid a memory-leak. Reported-by: Hiroki Kurosawa Closes #11093 --- diff --git a/lib/http.c b/lib/http.c index bffdd34685..15cf22c5e1 100644 --- a/lib/http.c +++ b/lib/http.c @@ -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;