]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
url: if curl_url_get() fails due to OOM, error out properly
authorDaniel Stenberg <daniel@haxx.se>
Thu, 4 Dec 2025 18:01:02 +0000 (19:01 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 4 Dec 2025 22:01:01 +0000 (23:01 +0100)
Even if the scheme is "file"!

Closes #19838

lib/url.c

index 043d7ca72cb3e2777c8a910a14a2ec4f388b2755..0643ceea7f8cb546589efb07af036f53ee6bfe1f 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -1919,7 +1919,8 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
   uc = curl_url_get(uh, CURLUPART_PORT, &data->state.up.port,
                     CURLU_DEFAULT_PORT);
   if(uc) {
-    if(!curl_strequal("file", data->state.up.scheme))
+    if((uc == CURLUE_OUT_OF_MEMORY) ||
+       !curl_strequal("file", data->state.up.scheme))
       return CURLE_OUT_OF_MEMORY;
   }
   else {