Fix a memory leak, from Japin Li in GitHub issue 3358.

This commit is contained in:
nicm 2022-10-25 09:12:05 +00:00
parent 0fc961b22e
commit 2111142cf1

View File

@ -1086,7 +1086,8 @@ cmd_parse_from_arguments(struct args_value *values, u_int count,
arg->type = CMD_PARSE_STRING; arg->type = CMD_PARSE_STRING;
arg->string = copy; arg->string = copy;
TAILQ_INSERT_TAIL(&cmd->arguments, arg, entry); TAILQ_INSERT_TAIL(&cmd->arguments, arg, entry);
} } else
free(copy);
} else if (values[i].type == ARGS_COMMANDS) { } else if (values[i].type == ARGS_COMMANDS) {
arg = xcalloc(1, sizeof *arg); arg = xcalloc(1, sizeof *arg);
arg->type = CMD_PARSE_PARSED_COMMANDS; arg->type = CMD_PARSE_PARSED_COMMANDS;