]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
url: fix return code for OOM in parse_proxy()
authorDaniel Stenberg <daniel@haxx.se>
Mon, 1 Dec 2025 08:26:28 +0000 (09:26 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 1 Dec 2025 09:18:58 +0000 (10:18 +0100)
Closes #19779

lib/url.c

index b4c33236cd67efce16049f2ed2040f185e4ac018..84909f037238b9cfbe3f948547c264e04fba5ff7 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -2250,11 +2250,15 @@ static CURLcode parse_proxy(struct Curl_easy *data,
 
   /* Is there a username and password given in this proxy url? */
   uc = curl_url_get(uhp, CURLUPART_USER, &proxyuser, CURLU_URLDECODE);
-  if(uc && (uc != CURLUE_NO_USER))
+  if(uc && (uc != CURLUE_NO_USER)) {
+    result = Curl_uc_to_curlcode(uc);
     goto error;
+  }
   uc = curl_url_get(uhp, CURLUPART_PASSWORD, &proxypasswd, CURLU_URLDECODE);
-  if(uc && (uc != CURLUE_NO_PASSWORD))
+  if(uc && (uc != CURLUE_NO_PASSWORD)) {
+    result = Curl_uc_to_curlcode(uc);
     goto error;
+  }
 
   if(proxyuser || proxypasswd) {
     curlx_free(proxyinfo->user);