am af59eec7: am e83d8a69: Merge "Fix memory leak in parse_action"

* commit 'af59eec776860514a70443dd94a1bcd130ed0ced':
  Fix memory leak in parse_action
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 @@
     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;