Fix leak when AppArmor encounters a deleted file

This commit is contained in:
John Johansen 2009-02-15 02:38:53 +00:00
parent 59f0d08417
commit 01519b3ae0
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,18 @@
---
security/apparmor/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/security/apparmor/main.c
+++ b/security/apparmor/main.c
@@ -503,10 +503,10 @@ static char *aa_get_name(struct dentry *
*buffer = buf;
return name;
}
+ kfree(buf);
if (PTR_ERR(name) != -ENAMETOOLONG)
return name;
- kfree(buf);
size <<= 1;
if (size > apparmor_path_max)
return ERR_PTR(-ENAMETOOLONG);

View file

@ -62,3 +62,4 @@ fix-config.diff
AppArmor-checkpatch.diff
AppArmor-misc-cleanups.diff
fix-config-builtin.diff
fix-deleted-leak.diff