Fix memory leak in parse_action
Change-Id: I3ed1da5674ae0b4ac50c1925e4f63af7f1748483
This commit is contained in:
parent
7746546b89
commit
ae392cf609
1 changed files with 7 additions and 0 deletions
|
@ -946,7 +946,14 @@ static void *parse_action(struct parse_state *state, int nargs, char **args)
|
|||
for (i = 1; i < nargs; i++) {
|
||||
if (!(i % 2)) {
|
||||
if (strcmp(args[i], "&&")) {
|
||||
struct listnode *node;
|
||||
struct listnode *node2;
|
||||
parse_error(state, "& is the only symbol allowed to concatenate actions\n");
|
||||
list_for_each_safe(node, node2, &act->triggers) {
|
||||
struct trigger *trigger = node_to_item(node, struct trigger, nlist);
|
||||
free(trigger);
|
||||
}
|
||||
free(act);
|
||||
return 0;
|
||||
} else
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue