mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lasse Collin <lasse.collin@tukaani.org>
To: Ivy Lopez <skunkolee@gmail.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lib: decompress_unxz: fix memory leak of 'in' buffer in single-call mode
Date: Wed, 26 Aug 2026 21:04:40 +0300	[thread overview]
Message-ID: <20260826210440.66213ad7.lasse.collin@tukaani.org> (raw)
In-Reply-To: <20260825230852.00121856.lasse.collin@tukaani.org>

The diff is good, but I would like a different commit message because
there was no bug. I wrote a suggestion below. If you think it's OK,
please submit v2 with the same diff and the new commit message to
Andrew Morton. Thanks!

----%<----
lib: decompress_unxz: Make it obvious that there is no memory leak

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.

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>
----%<----

-- 
Lasse Collin

  reply	other threads:[~2026-08-26 18:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25 19:13 Ivy Lopez
2026-08-25 20:08 ` Lasse Collin
2026-08-26 18:04   ` Lasse Collin [this message]
2026-09-01  1:41 ` [PATCH v2] lib: decompress_unxz: Make it obvious that there is no memory leak Ivy Lopez

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=20260826210440.66213ad7.lasse.collin@tukaani.org \
    --to=lasse.collin@tukaani.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®