summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2015-04-13 21:31:36 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-04-13 21:31:36 +0000
commit17b6a39f04c291c6002a22ec60eecdea51f86170 (patch)
tree58145cb07391258aad7238734d4d13b87ce413d4
parent51c6ad178e723a4cd59a143dd48d81ccdce2d489 (diff)
parentaf59eec776860514a70443dd94a1bcd130ed0ced (diff)
downloadsystem_core-17b6a39f04c291c6002a22ec60eecdea51f86170.zip
system_core-17b6a39f04c291c6002a22ec60eecdea51f86170.tar.gz
system_core-17b6a39f04c291c6002a22ec60eecdea51f86170.tar.bz2
am af59eec7: am e83d8a69: Merge "Fix memory leak in parse_action"
* commit 'af59eec776860514a70443dd94a1bcd130ed0ced': Fix memory leak in parse_action
-rw-r--r--init/init_parser.cpp7
1 files changed, 7 insertions, 0 deletions
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;