]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
url: if OOM in parse_proxy() return error
authorDaniel Stenberg <daniel@haxx.se>
Tue, 18 Nov 2025 13:29:36 +0000 (14:29 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 18 Nov 2025 13:54:16 +0000 (14:54 +0100)
Closes #19590

lib/url.c

index cf34514b1a9b6008f73666d3736dc5e0d4cf1ebe..527d69839049e13fe6d62f122ad1c9d68415633a 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -2285,7 +2285,11 @@ static CURLcode parse_proxy(struct Curl_easy *data,
     conn->bits.proxy_user_passwd = TRUE; /* enable it */
   }
 
-  (void)curl_url_get(uhp, CURLUPART_PORT, &portptr, 0);
+  uc = curl_url_get(uhp, CURLUPART_PORT, &portptr, 0);
+  if(uc == CURLUE_OUT_OF_MEMORY) {
+    result = CURLE_OUT_OF_MEMORY;
+    goto error;
+  }
 
   if(portptr) {
     curl_off_t num;