diff options
author | Jesper Juhl <juhl-lkml@dif.dk> | 2005-06-25 17:58:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 19:25:00 -0400 |
commit | 9a5f04bf798254390f89445ecf0b6f4c70ddc1f8 (patch) | |
tree | ed9aa17d9d980f3f013ccc84e12135c65b51757d /security/selinux/ss/policydb.c | |
parent | a2ba192c96d12447472e105890a9cd1b97952747 (diff) |
[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>
Diffstat (limited to 'security/selinux/ss/policydb.c')
-rw-r--r-- | security/selinux/ss/policydb.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 14190efbf333..785c33cf4864 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c | |||
@@ -590,17 +590,12 @@ void policydb_destroy(struct policydb *p) | |||
590 | hashtab_destroy(p->symtab[i].table); | 590 | hashtab_destroy(p->symtab[i].table); |
591 | } | 591 | } |
592 | 592 | ||
593 | for (i = 0; i < SYM_NUM; i++) { | 593 | for (i = 0; i < SYM_NUM; i++) |
594 | if (p->sym_val_to_name[i]) | 594 | kfree(p->sym_val_to_name[i]); |
595 | kfree(p->sym_val_to_name[i]); | ||
596 | } | ||
597 | 595 | ||
598 | if (p->class_val_to_struct) | 596 | kfree(p->class_val_to_struct); |
599 | kfree(p->class_val_to_struct); | 597 | kfree(p->role_val_to_struct); |
600 | if (p->role_val_to_struct) | 598 | kfree(p->user_val_to_struct); |
601 | kfree(p->role_val_to_struct); | ||
602 | if (p->user_val_to_struct) | ||
603 | kfree(p->user_val_to_struct); | ||
604 | 599 | ||
605 | avtab_destroy(&p->te_avtab); | 600 | avtab_destroy(&p->te_avtab); |
606 | 601 | ||