The patch titled Subject: lib/decompress_unxz.c: fix: possible memory leak in unxz() has been added to the -mm mm-nonmm-unstable branch. Its filename is fix-possible-memory-leak-in-unxz.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/fix-possible-memory-leak-in-unxz.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Vishnu Sanal T <t.v.s10123@xxxxxxxxx> Subject: lib/decompress_unxz.c: fix: possible memory leak in unxz() Date: Sun, 6 Oct 2024 12:55:43 +0530 Fix possible memory leak in the function unxz() in lib/decompress_unxz.c forgets to free the pointer 'in', when the statement if (fill == NULL && flush == NULL) is true. Link: https://lkml.kernel.org/r/20241006072542.66442-2-t.v.s10123@xxxxxxxxx Signed-off-by: Vishnu Sanal T <t.v.s10123@xxxxxxxxx> Cc: Lasse Collin <lasse.collin@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/decompress_unxz.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/lib/decompress_unxz.c~fix-possible-memory-leak-in-unxz +++ a/lib/decompress_unxz.c @@ -343,13 +343,13 @@ STATIC int INIT unxz(unsigned char *in, } } while (ret == XZ_OK); - if (must_free_in) - free(in); - if (flush != NULL) free(b.out); } + if (must_free_in) + free(in); + if (in_used != NULL) *in_used += b.in_pos; _ Patches currently in -mm which might be from t.v.s10123@xxxxxxxxx are fix-possible-memory-leak-in-unxz.patch