parse_args: redo the warnings for --remote-header-name combos

... to avoid the memory leak risk pointed out by scan-build.

Follow-up from 7a3e981781

Closes #7698
This commit is contained in:
Daniel Stenberg 2021-09-10 15:28:20 +02:00
parent 4fb5a643c8
commit 2b99f5e02c
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 13 additions and 13 deletions

View file

@ -2384,17 +2384,11 @@ ParameterError parse_args(struct GlobalConfig *global, int argc,
curlx_unicodefree(orig_opt);
}
if(config->content_disposition) {
if(config->show_headers) {
helpf(global->errors, "--include and --remote-header-name "
"cannot be combined.\n");
return PARAM_BAD_USE;
}
if(config->resume_from_current) {
helpf(global->errors, "--continue-at - and --remote-header-name "
"cannot be combined.\n");
return PARAM_BAD_USE;
}
if(!result && config->content_disposition) {
if(config->show_headers)
result = PARAM_CONTDISP_SHOW_HEADER;
else if(config->resume_from_current)
result = PARAM_CONTDISP_RESUME_FROM;
}
if(result && result != PARAM_HELP_REQUESTED &&