Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae392cf6 authored by Tom Cherry's avatar Tom Cherry
Browse files

Fix memory leak in parse_action

Change-Id: I3ed1da5674ae0b4ac50c1925e4f63af7f1748483
parent 7746546b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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;