]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
hostip: don't store negative lookup on OOM
authorDaniel Stenberg <daniel@haxx.se>
Wed, 12 Nov 2025 10:59:25 +0000 (11:59 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 12 Nov 2025 11:19:12 +0000 (12:19 +0100)
When convert_ipaddr_direct() returns error due to OOM, it must not be
stored as a negative cache result.

Closes #19484

lib/hostip.c

index 7e2551d8f301adc5d4ea5ceb8738b090bb4f8b46..ff7ac18c996b5a5db3b9672ce0290446af05d24f 100644 (file)
@@ -904,8 +904,10 @@ CURLcode Curl_resolv(struct Curl_easy *data,
 
 #ifndef USE_RESOLVE_ON_IPS
   /* allowed to convert, hostname is IP address, then NULL means error */
-  if(is_ipaddr)
+  if(is_ipaddr) {
+    keep_negative = FALSE;
     goto error;
+  }
 #endif
 
   /* Really need a resolver for hostname. */