tool_getparam: repair cleanarg

Regression since 9e5669f.

Make sure the "cleaning" of command line arguments is done on the
original argv[] pointers. As a bonus, it also exits better on out of
memory error.

Reported-by: Litter White
Fixes #9128
Closes #9130
This commit is contained in:
Daniel Stenberg 2022-07-10 15:22:13 +02:00
parent eab25898b3
commit bf7e887b24
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 45 additions and 38 deletions

View file

@ -54,7 +54,8 @@ typedef enum {
struct GlobalConfig;
struct OperationConfig;
ParameterError getparameter(const char *flag, char *nextarg, bool *usedarg,
ParameterError getparameter(const char *flag, char *nextarg, char *clearthis,
bool *usedarg,
struct GlobalConfig *global,
struct OperationConfig *operation);