Skip to content

Commit

Permalink
tomoyo: fix memory leak in tomoyo_commit_ok()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Tetsuo Handa <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
chobits authored and James Morris committed Mar 30, 2011
1 parent 93b9c98 commit cfc64fd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions security/tomoyo/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ void *tomoyo_commit_ok(void *data, const unsigned int size)
memset(data, 0, size);
return ptr;
}
kfree(ptr);
return NULL;
}

Expand Down

0 comments on commit cfc64fd

Please sign in to comment.