]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_getparam: fix "Ignored Return Value"
authorDaniel Stenberg <daniel@haxx.se>
Sat, 14 Dec 2024 09:34:45 +0000 (10:34 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 14 Dec 2024 10:50:23 +0000 (11:50 +0100)
Follow-up from a300879b63b

Pointed out by CodeSonar

Closes #15740

src/tool_getparam.c

index 63b328c1897c66411c887b80c7dad968b6306418..fc232634140fb79509c4da8231ccd597b4661752 100644 (file)
@@ -1051,8 +1051,8 @@ static ParameterError parse_url(struct GlobalConfig *global,
     /* fill in the URL */
     err = getstr(&url->url, nextarg, DENY_BLANK);
     url->flags |= GETOUT_URL;
-    if((++config->num_urls > 1) && (config->etag_save_file ||
-                                    config->etag_compare_file)) {
+    if(!err && (++config->num_urls > 1) && (config->etag_save_file ||
+                                            config->etag_compare_file)) {
       errorf(global, "The etag options only work on a single URL");
       return PARAM_BAD_USE;
     }