fix failure paths around policy that can result in a crash

Signed-off-by: John Johansen <[email protected]>

---
 parser/parser_regex.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- 2.9-test.orig/parser/parser_regex.c
+++ 2.9-test/parser/parser_regex.c
@@ -712,6 +712,9 @@
                prof->policy.rules = NULL;
                if (!prof->policy.dfa)
                        goto out;
+       } else {
+               aare_delete_ruleset(prof->policy.rules);
+               prof->policy.rules = NULL;
        }
 
        aare_reset_matchflags();
@@ -719,6 +722,9 @@
        error = 0;
 
 out:
+       aare_delete_ruleset(prof->policy.rules);
+       prof->policy.rules = NULL;
+
        return error;
 }
 


-- 
AppArmor mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to