diff options
author | Xiaochen Wang <wangxiaochen0@gmail.com> | 2011-03-30 11:27:32 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2011-03-30 19:25:06 -0400 |
commit | cfc64fd91fabed099a4c3df58559f4b7efe9bcce (patch) | |
tree | 6ecc7efb4d61ba9e1ae21a11e50f175961f76cf8 /security/tomoyo | |
parent | 93b9c98b3498db5842e2812b32cff4c1ae947eb1 (diff) |
tomoyo: fix memory leak in tomoyo_commit_ok()
When memory used for policy exceeds the quota, tomoyo_memory_ok() return false.
In this case, tomoyo_commit_ok() must call kfree() before returning NULL.
This bug exists since 2.6.35.
Signed-off-by: Xiaochen Wang <wangxiaochen0@gmail.com>
Acked-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo')
-rw-r--r-- | security/tomoyo/memory.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/security/tomoyo/memory.c b/security/tomoyo/memory.c index 297612669c74..42a7b1ba8cbf 100644 --- a/security/tomoyo/memory.c +++ b/security/tomoyo/memory.c | |||
@@ -75,6 +75,7 @@ void *tomoyo_commit_ok(void *data, const unsigned int size) | |||
75 | memset(data, 0, size); | 75 | memset(data, 0, size); |
76 | return ptr; | 76 | return ptr; |
77 | } | 77 | } |
78 | kfree(ptr); | ||
78 | return NULL; | 79 | return NULL; |
79 | } | 80 | } |
80 | 81 | ||