From: Daniel Stenberg Date: Tue, 25 Nov 2025 09:07:30 +0000 (+0100) Subject: asyn-ares: handle Curl_dnscache_mk_entry() OOM error X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b8f83738c3ab01c214a314981626c86c9ffaca72;p=thirdparty%2Fcurl.git asyn-ares: handle Curl_dnscache_mk_entry() OOM error To avoid leaking memory. Follow-up to ce06fe7771052549ff430 Closes #19688 --- diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index d459fd4a75..1bc0f3247b 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -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);