]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_getparam: repair the error message for unknown flag
authorDaniel Stenberg <daniel@haxx.se>
Wed, 17 Jun 2020 22:51:37 +0000 (00:51 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 18 Jun 2020 11:59:42 +0000 (13:59 +0200)
Follow-up to 9e5669f3880674
Detected by Coverity CID 1464582 ("Logically dead code")

Closes #5577

src/tool_getparam.c

index bd989fada90a859b3f268d7b9effc3e45ad8bcfc..0cd11c47986eb06279fac6b0af81461c0d709104 100644 (file)
@@ -2303,7 +2303,8 @@ ParameterError parse_args(struct GlobalConfig *global, int argc,
                             config);
     }
 
-    curlx_unicodefree(orig_opt);
+    if(!result)
+      curlx_unicodefree(orig_opt);
   }
 
   if(result && result != PARAM_HELP_REQUESTED &&