Skip to content

Commit

Permalink
Fix a memory leak, from Japin Li in GitHub issue 3358.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicm committed Oct 25, 2022
1 parent 0fc961b commit 2111142
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd-parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,8 @@ cmd_parse_from_arguments(struct args_value *values, u_int count,
arg->type = CMD_PARSE_STRING;
arg->string = copy;
TAILQ_INSERT_TAIL(&cmd->arguments, arg, entry);
}
} else
free(copy);
} else if (values[i].type == ARGS_COMMANDS) {
arg = xcalloc(1, sizeof *arg);
arg->type = CMD_PARSE_PARSED_COMMANDS;
Expand Down

0 comments on commit 2111142

Please sign in to comment.