]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
asyn-ares: remove hostname free on OOM
authorDaniel Stenberg <daniel@haxx.se>
Sun, 23 Nov 2025 13:42:59 +0000 (14:42 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 23 Nov 2025 14:13:54 +0000 (15:13 +0100)
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

lib/asyn-ares.c

index ad9147a01c3421267f91bafdc8edfe055fa3cdd8..e01f7ba3d24e38bc78d3989282f7ac936bc5e107 100644 (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