[apparmor] RFC [patch 8/10] fix failure paths around policy that can result in a crash

John Johansen john.johansen at canonical.com
Thu Feb 13 01:04:37 UTC 2014


fix failure paths around policy that can result in a crash

Signed-off-by: John Johansen <john.johansen at canonical.com>

---
 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;
 }
 




More information about the AppArmor mailing list