[PATCH] selinux: kfree cleanup

kfree(NULL) is legal.

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Jesper Juhl
2005-06-25 14:58:51 -07:00
committed by Linus Torvalds
parent a2ba192c96
commit 9a5f04bf79
5 changed files with 14 additions and 28 deletions

View File

@ -590,17 +590,12 @@ void policydb_destroy(struct policydb *p)
hashtab_destroy(p->symtab[i].table);
}
for (i = 0; i < SYM_NUM; i++) {
if (p->sym_val_to_name[i])
kfree(p->sym_val_to_name[i]);
}
for (i = 0; i < SYM_NUM; i++)
kfree(p->sym_val_to_name[i]);
if (p->class_val_to_struct)
kfree(p->class_val_to_struct);
if (p->role_val_to_struct)
kfree(p->role_val_to_struct);
if (p->user_val_to_struct)
kfree(p->user_val_to_struct);
kfree(p->class_val_to_struct);
kfree(p->role_val_to_struct);
kfree(p->user_val_to_struct);
avtab_destroy(&p->te_avtab);