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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user