diff options
author | Thomas Adam <thomas@xteddy.org> | 2024-04-15 12:01:11 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2024-04-15 12:01:11 +0100 |
commit | 036d8993e6daf37becf2782e98218b9be9ae8520 (patch) | |
tree | 6726e50da111114c8a42c33e585ae19f8ed28584 /arguments.c | |
parent | dd4c0109a93eee6830d55612f106a711dfd83791 (diff) | |
parent | e8530c9feedde2fd4b25b0ec1f5bcfe7b3cf8b65 (diff) |
Merge branch 'obsd-master'
Diffstat (limited to 'arguments.c')
-rw-r--r-- | arguments.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arguments.c b/arguments.c index 669375e2..bf95b453 100644 --- a/arguments.c +++ b/arguments.c @@ -171,6 +171,8 @@ args_parse_flag_argument(struct args_value *values, u_int count, char **cause, if (optional_argument) { log_debug("%s: -%c (optional)", __func__, flag); args_set(args, flag, NULL, ARGS_ENTRY_OPTIONAL_VALUE); + args_free_value(new); + free(new); return (0); /* either - or end */ } xasprintf(cause, "-%c expects an argument", flag); @@ -662,6 +664,8 @@ args_set(struct args *args, u_char flag, struct args_value *value, int flags) entry->count++; if (value != NULL && value->type != ARGS_NONE) TAILQ_INSERT_TAIL(&entry->values, value, entry); + else + free(value); } /* Get argument value. Will be NULL if it isn't present. */ |