2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-30 22:05:27 +00:00

fix failure paths around policy that can result in a crash

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
This commit is contained in:
John Johansen
2014-04-15 15:01:05 -07:00
parent 6eeaabb33c
commit c9ed990016

View File

@@ -712,6 +712,9 @@ int process_profile_policydb(Profile *prof)
prof->policy.rules = NULL; prof->policy.rules = NULL;
if (!prof->policy.dfa) if (!prof->policy.dfa)
goto out; goto out;
} else {
aare_delete_ruleset(prof->policy.rules);
prof->policy.rules = NULL;
} }
aare_reset_matchflags(); aare_reset_matchflags();
@@ -719,6 +722,9 @@ int process_profile_policydb(Profile *prof)
error = 0; error = 0;
out: out:
aare_delete_ruleset(prof->policy.rules);
prof->policy.rules = NULL;
return error; return error;
} }