]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
config2setopts: bail out if curl_url_get() returns OOM
authorDaniel Stenberg <daniel@haxx.se>
Thu, 13 Nov 2025 22:03:52 +0000 (23:03 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 14 Nov 2025 08:39:42 +0000 (09:39 +0100)
Closes #19518

src/config2setopts.c

index 57e7a7337669bd17854fae1500ede623897c5ac9..7d099602d30b486d883ab52415822b2bbc09af03 100644 (file)
@@ -141,8 +141,9 @@ static CURLcode url_proto_and_rewrite(char **url,
       curl_url_set(uh, CURLUPART_URL, *url,
                    CURLU_GUESS_SCHEME | CURLU_NON_SUPPORT_SCHEME);
     if(!uc) {
-      if(!curl_url_get(uh, CURLUPART_SCHEME, &schemep,
-                       CURLU_DEFAULT_SCHEME)) {
+      uc = curl_url_get(uh, CURLUPART_SCHEME, &schemep,
+                        CURLU_DEFAULT_SCHEME);
+      if(!uc) {
 #ifdef CURL_DISABLE_IPFS
         (void)config;
 #else
@@ -162,6 +163,8 @@ static CURLcode url_proto_and_rewrite(char **url,
           proto = proto_token(schemep);
         curl_free(schemep);
       }
+      else if(uc == CURLUE_OUT_OF_MEMORY)
+        result = CURLE_OUT_OF_MEMORY;
     }
     else if(uc == CURLUE_OUT_OF_MEMORY)
       result = CURLE_OUT_OF_MEMORY;