am e83d8a69: Merge "Fix memory leak in parse_action"
* commit 'e83d8a6900ee53942e5939656c3b6ae177d1f1d2': Fix memory leak in parse_action
This commit is contained in:
commit
af59eec776
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++) {
|
for (i = 1; i < nargs; i++) {
|
||||||
if (!(i % 2)) {
|
if (!(i % 2)) {
|
||||||
if (strcmp(args[i], "&&")) {
|
if (strcmp(args[i], "&&")) {
|
||||||
|
struct listnode *node;
|
||||||
|
struct listnode *node2;
|
||||||
parse_error(state, "& is the only symbol allowed to concatenate actions\n");
|
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;
|
return 0;
|
||||||
} else
|
} else
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue