pstore: Fix memory leak when decompress using big_oops_buf

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>
This commit is contained in:
Liu ShuoX 2014-03-12 21:34:06 +08:00 committed by Tony Luck
parent 017321cf39
commit e32634f5d5

View File

@ -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;