[PATCH] libelf: decompress: ensure zlib resource cleanup

2020-03-15 Thread Matthias Maennich via Elfutils-devel
__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() in the error case as well. Fixes: 272018bba1f2 ("libelf: Add elf_compress and elf_compress_gnu.") Signed-off-by: Matthias Maennich

Re: [PATCH] libelf: decompress: ensure zlib resource cleanup

2020-03-15 Thread Mark Wielaard
Hi Matthias, On Sun, 2020-03-15 at 23:03 +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() in the error case as well. > >

Re: [PATCH] libelf: decompress: ensure zlib resource cleanup

2020-03-15 Thread Matthias Maennich via Elfutils-devel
Hi Mark! Thanks for the quick response! On Mon, Mar 16, 2020 at 12:10:51AM +0100, Mark Wielaard wrote: Hi Matthias, On Sun, 2020-03-15 at 23:03 +0100, Matthias Maennich via Elfutils-devel wrote: __libelf_decompress would only cleanup zlib resources via inflateEnd() in case inflating was succe