Skip to content
Snippets Groups Projects
Commit cfc64fd9 authored by Xiaochen Wang's avatar Xiaochen Wang Committed by James Morris
Browse files

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: default avatarXiaochen Wang <wangxiaochen0@gmail.com>
Acked-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 93b9c98b
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,7 @@ void *tomoyo_commit_ok(void *data, const unsigned int size)
memset(data, 0, size);
return ptr;
}
kfree(ptr);
return NULL;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment