public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mjw@redhat.com>
To: elfutils-devel@lists.fedorahosted.org
Subject: Re: [PATCH] libelf: Fix memory leak in elf_compress for mmapped ELF files.
Date: Tue, 16 Aug 2016 20:45:40 +0200	[thread overview]
Message-ID: <20160816184540.GG2702@stream> (raw)
In-Reply-To: 1470602338-28268-1-git-send-email-mjw@redhat.com

[-- Attachment #1: Type: text/plain, Size: 703 bytes --]

On Sun, Aug 07, 2016 at 10:38:58PM +0200, Mark Wielaard wrote:
> The testcase added to run-strip-reloc.sh for strip-compressed.o showed
> a memory leak when ran under valgrind (configure --enable-valgrind).
> 
> For a mmapped ELF file when existing section data was compressed
> elf_end would fail to release the new compressed data buffer assigned
> to rawdata_base. For non-mapped files rawdata_base is always freed.
> For decompressed data rawdata_base is released together with zdata_base.
> 
> Use the Elf_Scn flag ELF_T_MALLOCED to track whether rawdata_base
> points to malloced memory and free it in elf_end even for mmapped
> ELF files.

I pushed this to master.

Cheers,

Mark

             reply	other threads:[~2016-08-16 18:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-16 18:45 Mark Wielaard [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-08-07 20:38 Mark Wielaard

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=20160816184540.GG2702@stream \
    --to=mjw@redhat.com \
    --cc=elfutils-devel@lists.fedorahosted.org \
    /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).