http: free the url before storing a new copy

To avoid a memory-leak.

Reported-by: Hiroki Kurosawa

Closes #11093
This commit is contained in:
Daniel Stenberg 2023-05-09 08:31:11 +02:00
parent 6708498588
commit f7170a8f2e
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View 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;