]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
urlapi: set uncondtional return code
authorDaniel Stenberg <daniel@haxx.se>
Sun, 28 Dec 2025 21:40:47 +0000 (22:40 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 29 Dec 2025 09:17:49 +0000 (10:17 +0100)
Curl_parse_login_details() can only return a single return code so
adjust accordingly.

Pointed out by CodeSonar

Closes #20107

lib/urlapi.c

index c8a7a8c280578beeeb1a160b3c5b6c9ee18db693..e974783d71d70d475a63bb1c534910b240ab1813 100644 (file)
@@ -368,8 +368,9 @@ static CURLUcode parse_hostname_login(struct Curl_URL *u,
                                    (h && (h->flags & PROTOPT_URLOPTIONS)) ?
                                    &optionsp : NULL);
   if(ccode) {
-    result = (ccode == CURLE_OUT_OF_MEMORY) ? CURLUE_OUT_OF_MEMORY :
-      CURLUE_BAD_LOGIN;
+    /* the only possible error from Curl_parse_login_details is out of
+       memory: */
+    result = CURLUE_OUT_OF_MEMORY;
     goto out;
   }