diff options
author | Jesper Juhl <juhl-lkml@dif.dk> | 2005-06-25 23:58:51 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-26 01:25:00 +0200 |
commit | 9a5f04bf798254390f89445ecf0b6f4c70ddc1f8 (patch) | |
tree | ed9aa17d9d980f3f013ccc84e12135c65b51757d /security/selinux/ss/policydb.c | |
parent | [PATCH] drivers/scsi/initio.c: cleanups (diff) | |
download | linux-9a5f04bf798254390f89445ecf0b6f4c70ddc1f8.tar.xz linux-9a5f04bf798254390f89445ecf0b6f4c70ddc1f8.zip |
[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) 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); |