Skip to content

Commit

Permalink
pstore: Fix memory leak when decompress using big_oops_buf
Browse files Browse the repository at this point in the history
After sucessful decompressing, the buffer which pointed by 'buf' will be
lost as 'buf' is overwrite by 'big_oops_buf' and will never be freed.

Signed-off-by: Liu ShuoX <shuox.liu@intel.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Liu ShuoX authored and Tony Luck committed Mar 17, 2014
1 parent 017321c commit e32634f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/pstore/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ void pstore_get_records(int quiet)
big_oops_buf_sz);

if (unzipped_len > 0) {
kfree(buf);
buf = big_oops_buf;
size = unzipped_len;
compressed = false;
Expand Down

0 comments on commit e32634f

Please sign in to comment.