From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,lasse.collin@tukaani.org,skunkolee@gmail.com,akpm@linux-foundation.org
Subject: + lib-decompress_unxz-make-it-obvious-that-there-is-no-memory-leak.patch added to mm-nonmm-unstable branch
Date: Mon, 31 Aug 2026 19:12:41 -0700 [thread overview]
Message-ID: <20260901021242.059EF1F00A3D@smtp.kernel.org> (raw)
The patch titled
Subject: lib: decompress_unxz: make it obvious that there is no memory leak
has been added to the -mm mm-nonmm-unstable branch. Its filename is
lib-decompress_unxz-make-it-obvious-that-there-is-no-memory-leak.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/lib-decompress_unxz-make-it-obvious-that-there-is-no-memory-leak.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 various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Ivy Lopez <skunkolee@gmail.com>
Subject: lib: decompress_unxz: make it obvious that there is no memory leak
Date: Mon, 31 Aug 2026 19:41:38 -0600
Calling __decompress() or unxz() with fill == NULL && flush == NULL && in
== NULL is invalid, thus there were no memory leaks even though it might
have looked like that. Move the conditional free() calls so that it's
obvious that there are no leaks.
Link: https://lore.kernel.org/20260901014138.22699-1-skunkolee@gmail.com
Signed-off-by: Ivy Lopez <skunkolee@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=207113
Link: https://lore.kernel.org/lkml/20241006072542.66442-2-t.v.s10123@gmail.com/T/
Link: https://lore.kernel.org/lkml/20260825191333.34276-1-skunkolee@gmail.com/T/
Reviewed-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
lib/decompress_unxz.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/lib/decompress_unxz.c~lib-decompress_unxz-make-it-obvious-that-there-is-no-memory-leak
+++ a/lib/decompress_unxz.c
@@ -342,13 +342,13 @@ STATIC int INIT unxz(unsigned char *in,
b.out_pos = 0;
}
} while (ret == XZ_OK);
+ }
- if (must_free_in)
- free(in);
+ if (must_free_in)
+ free(in);
- if (flush != NULL)
- free(b.out);
- }
+ if (flush != NULL)
+ free(b.out);
if (in_used != NULL)
*in_used += b.in_pos;
_
Patches currently in -mm which might be from skunkolee@gmail.com are
lib-decompress_unxz-make-it-obvious-that-there-is-no-memory-leak.patch
reply other threads:[~2026-09-01 2:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260901021242.059EF1F00A3D@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=lasse.collin@tukaani.org \
--cc=mm-commits@vger.kernel.org \
--cc=skunkolee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.