fixup clear data->req.cookiehost in http_set_aptr_host

This commit is contained in:
Daniel Stenberg 2026-04-14 16:38:45 +02:00
parent 724298c3f0
commit 04bffc4ba3
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -2046,6 +2046,9 @@ static CURLcode http_set_aptr_host(struct Curl_easy *data)
data->state.first_remote_protocol = conn->scheme->protocol;
}
curlx_safefree(aptr->host);
#ifndef CURL_DISABLE_COOKIES
curlx_safefree(data->req.cookiehost);
#endif
ptr = Curl_checkheaders(data, STRCONST("Host"));
if(ptr && (!data->state.this_is_a_follow ||
@ -2081,7 +2084,6 @@ static CURLcode http_set_aptr_host(struct Curl_easy *data)
if(colon)
*colon = 0; /* The host must not include an embedded port number */
}
curlx_free(data->req.cookiehost);
data->req.cookiehost = cookiehost;
}
#endif