From: Liu ShuoX Date: Wed, 12 Mar 2014 13:34:06 +0000 (+0800) Subject: pstore: Fix memory leak when decompress using big_oops_buf X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e32634f5d57f1dce88624b70a6d625915f6ea09e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Acked-by: Kees Cook Signed-off-by: Tony Luck --- diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 78c3c2097787..46d269e38706 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -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;