public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Matthias Maennich <maennich@google.com>, elfutils-devel@sourceware.org
Cc: kernel-team@android.com
Subject: Re: [PATCH v2] libelf: {de,}compress: ensure zlib resource cleanup
Date: Fri, 20 Mar 2020 18:10:06 +0100	[thread overview]
Message-ID: <146b2fb6815840d6c566a52140ffa62699e66de2.camel@klomp.org> (raw)
In-Reply-To: <20200320111755.67258-1-maennich@google.com>

Hi Matthias,

On Fri, 2020-03-20 at 12:17 +0100, Matthias Maennich via Elfutils-devel wrote:
> __libelf_decompress would only cleanup zlib resources via inflateEnd()
> in case inflating was successful, but would leak memory if not. Fix this
> by calling inflateEnd() unconditionally.
> 
> __libelf_decompress did this all the time already, but called
> deflateEnd() twice. That is not a (known) issue, but can be cleaned up
> by ensuring all error paths use 'return deflate_cleanup' and the success
> path calls deflateEnd() only once. Note, the deflate() needs to return
> Z_STREAM_END to indicate we are done. Hence change the condition.

It was that last condition I had missed.
Added a ChangeLog entry and pushed to master.

Thanks,

Mark

  reply	other threads:[~2020-03-20 17:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-15 22:03 [PATCH] libelf: decompress: " Matthias Maennich
2020-03-15 23:10 ` Mark Wielaard
2020-03-15 23:42   ` Matthias Maennich
2020-03-16 12:05     ` Mark Wielaard
2020-03-16 12:18       ` Mark Wielaard
2020-03-20 11:17 ` [PATCH v2] libelf: {de,}compress: " Matthias Maennich
2020-03-20 17:10   ` Mark Wielaard [this message]
2020-04-24 23:28   ` Mark Wielaard
2020-04-27  8:14     ` Matthias Maennich

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=146b2fb6815840d6c566a52140ffa62699e66de2.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=kernel-team@android.com \
    --cc=maennich@google.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).