projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d1bbf14
)
[PATCH] selinux: fix memory leak
author
Darrel Goeddel
<
[email protected]
>
Sun, 30 Jul 2006 10:03:17 +0000
(
03:03
-0700)
committer
Linus Torvalds
<
[email protected]
>
Mon, 31 Jul 2006 20:28:37 +0000
(13:28 -0700)
This patch fixes a memory leak when a policydb structure is destroyed.
Signed-off-by: Darrel Goeddel <
[email protected]
>
Signed-off-by: Stephen Smalley <
[email protected]
>
Acked-by: James Morris <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
security/selinux/ss/policydb.c
patch
|
blob
|
history
diff --git
a/security/selinux/ss/policydb.c
b/security/selinux/ss/policydb.c
index 0111990ba8378e6ac8222817f92b188aa50ea299..f03960e697ceb5a3f27e1b54dc0bbbaba437b0bb 100644
(file)
--- a/
security/selinux/ss/policydb.c
+++ b/
security/selinux/ss/policydb.c
@@
-644,10
+644,18
@@
void policydb_destroy(struct policydb *p)
kfree(lra);
for (rt = p->range_tr; rt; rt = rt -> next) {
- kfree(lrt);
+ if (lrt) {
+ ebitmap_destroy(&lrt->range.level[0].cat);
+ ebitmap_destroy(&lrt->range.level[1].cat);
+ kfree(lrt);
+ }
lrt = rt;
}
- kfree(lrt);
+ if (lrt) {
+ ebitmap_destroy(&lrt->range.level[0].cat);
+ ebitmap_destroy(&lrt->range.level[1].cat);
+ kfree(lrt);
+ }
if (p->type_attr_map) {
for (i = 0; i < p->p_types.nprim; i++)