From ae392cf609536e3d57ffcfefec82064347f0259e Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Mon, 13 Apr 2015 13:07:04 -0700 Subject: Fix memory leak in parse_action Change-Id: I3ed1da5674ae0b4ac50c1925e4f63af7f1748483 --- init/init_parser.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init/init_parser.cpp b/init/init_parser.cpp index af935d7..ff31093 100644 --- a/init/init_parser.cpp +++ b/init/init_parser.cpp @@ -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; -- cgit v1.1