asyn-ares: remove hostname free on OOM

The freeing of the already allocated hostname is done by
Curl_async_shutdown(). This extra free in the RR code path made a
double-free.

Presumably not detected because the CI torture tests don't run HTTPS-RR
enabled?

Follow-up to 8d0bfe74fb
Closes #19658
This commit is contained in:
Daniel Stenberg 2025-11-23 14:42:59 +01:00
parent f13f320dee
commit 74f7505974
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -748,10 +748,8 @@ struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data,
#ifdef USE_HTTPSRR
if(port != 443) {
rrname = curl_maprintf("_%d_.https.%s", port, hostname);
if(!rrname) {
free(data->state.async.hostname);
if(!rrname)
return NULL;
}
}
#endif