2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +00:00

parser: make sure xattr cond_entry_list is not leaked

Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
John Johansen
2019-08-17 05:01:39 -07:00
parent 6b47b8de25
commit 9b0a98d00e
5 changed files with 16 additions and 2 deletions

View File

@@ -997,11 +997,21 @@ void free_cond_list(struct cond_entry *ents)
{
struct cond_entry *entry, *tmp;
list_for_each_safe(ents, entry, tmp) {
free_cond_entry(entry);
if (ents) {
list_for_each_safe(ents, entry, tmp) {
free_cond_entry(entry);
}
}
}
void free_cond_entry_list(struct cond_entry_list &cond)
{
free_cond_list(cond.list);
free(cond.name);
cond.list = NULL;
cond.name = NULL;
}
void print_cond_entry(struct cond_entry *ent)
{
if (ent) {