]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Curl_resolv: explicitly set *entry to NULL at the top
authorx2018 <xkernel.wang@foxmail.com>
Tue, 28 Oct 2025 05:16:36 +0000 (13:16 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 28 Oct 2025 10:39:13 +0000 (11:39 +0100)
Closes #19263

lib/hostip.c

index d4b1b87e7ad54c5bb6c683646618326fdb2fa788..7e2551d8f301adc5d4ea5ceb8738b090bb4f8b46 100644 (file)
@@ -848,6 +848,8 @@ CURLcode Curl_resolv(struct Curl_easy *data,
   size_t hostname_len;
   bool keep_negative = TRUE; /* cache a negative result */
 
+  *entry = NULL;
+
 #ifndef CURL_DISABLE_DOH
   data->conn->bits.doh = FALSE; /* default is not */
 #else
@@ -969,7 +971,6 @@ out:
 error:
   if(dns)
     Curl_resolv_unlink(data, &dns);
-  *entry = NULL;
   Curl_async_shutdown(data);
   if(keep_negative)
     store_negative_resolve(data, hostname, port);