]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_operate: remove redundant condition
authorDaniel Stenberg <daniel@haxx.se>
Thu, 6 Nov 2025 08:52:30 +0000 (09:52 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 6 Nov 2025 10:39:52 +0000 (11:39 +0100)
And avoid an early return.

Pointed out by CodeSonar

Closes #19381

src/tool_operate.c

index 46a3f200bb3dbc53fc94226ba09217dca52e8222..74f5da5fa91598586c186ee5ba6b90ef9531c5e3 100644 (file)
@@ -2116,22 +2116,21 @@ static CURLcode transfer_per_config(struct OperationConfig *config,
                                     bool *added,
                                     bool *skipped)
 {
-  CURLcode result = CURLE_OK;
+  CURLcode result;
   *added = FALSE;
 
   /* Check we have a url */
   if(!config->url_list || !config->url_list->url) {
     helpf("(%d) no URL specified", CURLE_FAILED_INIT);
-    return CURLE_FAILED_INIT;
+    result = CURLE_FAILED_INIT;
   }
-
-  if(!result)
+  else {
     result = cacertpaths(config);
-
-  if(!result) {
-    result = single_transfer(config, share, added, skipped);
-    if(!*added || result)
-      single_transfer_cleanup();
+    if(!result) {
+      result = single_transfer(config, share, added, skipped);
+      if(!*added || result)
+        single_transfer_cleanup();
+    }
   }
 
   return result;