diff options
author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-07-02 08:39:09 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-07-02 08:39:09 -0400 |
commit | d2f6409584e2c62ffad81690562330ff3bf4a458 (patch) | |
tree | 3bdfb97d0b51be2f7f414f2107e97603c1206abb /security/selinux/ss | |
parent | e1b09eba2686eca94a3a188042b518df6044a3c1 (diff) | |
parent | 4a89a04f1ee21a7c1f4413f1ad7dcfac50ff9b63 (diff) |
Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'security/selinux/ss')
-rw-r--r-- | security/selinux/ss/conditional.c | 9 | ||||
-rw-r--r-- | security/selinux/ss/policydb.c | 15 | ||||
-rw-r--r-- | security/selinux/ss/services.c | 6 |
3 files changed, 10 insertions, 20 deletions
diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c index b53441184aca..e2057f5a411a 100644 --- a/security/selinux/ss/conditional.c +++ b/security/selinux/ss/conditional.c | |||
@@ -166,16 +166,14 @@ static void cond_list_destroy(struct cond_node *list) | |||
166 | 166 | ||
167 | void cond_policydb_destroy(struct policydb *p) | 167 | void cond_policydb_destroy(struct policydb *p) |
168 | { | 168 | { |
169 | if (p->bool_val_to_struct != NULL) | 169 | kfree(p->bool_val_to_struct); |
170 | kfree(p->bool_val_to_struct); | ||
171 | avtab_destroy(&p->te_cond_avtab); | 170 | avtab_destroy(&p->te_cond_avtab); |
172 | cond_list_destroy(p->cond_list); | 171 | cond_list_destroy(p->cond_list); |
173 | } | 172 | } |
174 | 173 | ||
175 | int cond_init_bool_indexes(struct policydb *p) | 174 | int cond_init_bool_indexes(struct policydb *p) |
176 | { | 175 | { |
177 | if (p->bool_val_to_struct) | 176 | kfree(p->bool_val_to_struct); |
178 | kfree(p->bool_val_to_struct); | ||
179 | p->bool_val_to_struct = (struct cond_bool_datum**) | 177 | p->bool_val_to_struct = (struct cond_bool_datum**) |
180 | kmalloc(p->p_bools.nprim * sizeof(struct cond_bool_datum*), GFP_KERNEL); | 178 | kmalloc(p->p_bools.nprim * sizeof(struct cond_bool_datum*), GFP_KERNEL); |
181 | if (!p->bool_val_to_struct) | 179 | if (!p->bool_val_to_struct) |
@@ -185,8 +183,7 @@ int cond_init_bool_indexes(struct policydb *p) | |||
185 | 183 | ||
186 | int cond_destroy_bool(void *key, void *datum, void *p) | 184 | int cond_destroy_bool(void *key, void *datum, void *p) |
187 | { | 185 | { |
188 | if (key) | 186 | kfree(key); |
189 | kfree(key); | ||
190 | kfree(datum); | 187 | kfree(datum); |
191 | return 0; | 188 | return 0; |
192 | } | 189 | } |
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 | ||
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 2947cf85dc56..bfa5a7dd6cf5 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c | |||
@@ -1705,11 +1705,9 @@ out: | |||
1705 | err: | 1705 | err: |
1706 | if (*names) { | 1706 | if (*names) { |
1707 | for (i = 0; i < *len; i++) | 1707 | for (i = 0; i < *len; i++) |
1708 | if ((*names)[i]) | 1708 | kfree((*names)[i]); |
1709 | kfree((*names)[i]); | ||
1710 | } | 1709 | } |
1711 | if (*values) | 1710 | kfree(*values); |
1712 | kfree(*values); | ||
1713 | goto out; | 1711 | goto out; |
1714 | } | 1712 | } |
1715 | 1713 | ||