]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
asyn-ares: use the duped hostname pointer for all calls
authorDaniel Stenberg <daniel@haxx.se>
Thu, 9 Oct 2025 15:23:56 +0000 (17:23 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 9 Oct 2025 20:03:59 +0000 (22:03 +0200)
In one c-ares call the passed in pointer was used and not the new
duplicated one. This is probably fine but might as well use the new
pointer as all the other calls do, which will survive longer.

Reported-by: Joshua Rogers
Closes #18980

lib/asyn-ares.c

index 236697695eda9e25e7a29b22336a9a339dd73750..dcbed0129c739fa59c62447a2fc343169b8cacda 100644 (file)
@@ -793,7 +793,7 @@ struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data,
     /* The stack seems to be IPv6-enabled */
     /* areschannel is already setup in the Curl_open() function */
     CURL_TRC_DNS(data, "asyn-ares: fire off query for A");
-    ares_gethostbyname(ares->channel, hostname, PF_INET,
+    ares_gethostbyname(ares->channel, data->state.async.hostname, PF_INET,
                        async_ares_hostbyname_cb, data);
     CURL_TRC_DNS(data, "asyn-ares: fire off query for AAAA");
     ares->num_pending = 2;