]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
asyn-ares: handle Curl_dnscache_mk_entry() OOM error
authorDaniel Stenberg <daniel@haxx.se>
Tue, 25 Nov 2025 09:07:30 +0000 (10:07 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 25 Nov 2025 09:26:56 +0000 (10:26 +0100)
To avoid leaking memory.

Follow-up to ce06fe7771052549ff430
Closes #19688

lib/asyn-ares.c

index d459fd4a75cd7ca8fe022f69431c092fd0384e7b..1bc0f3247b78ff285e2116d5cbfec756bcd54dca 100644 (file)
@@ -343,7 +343,8 @@ CURLcode Curl_async_is_resolved(struct Curl_easy *data,
         Curl_dnscache_mk_entry(data, ares->temp_ai,
                                data->state.async.hostname, 0,
                                data->state.async.port, FALSE);
-      ares->temp_ai = NULL; /* temp_ai now owned by entry */
+      if(data->state.async.dns)
+        ares->temp_ai = NULL; /* temp_ai now owned by entry */
 #ifdef HTTPSRR_WORKS
       if(data->state.async.dns) {
         struct Curl_https_rrinfo *lhrr = Curl_httpsrr_dup_move(&ares->hinfo);