diff options
| author | Matthias Maennich <maennich@google.com> | 2020-03-20 17:38:55 +0100 |
|---|---|---|
| committer | Mark Wielaard <mark@klomp.org> | 2020-03-20 18:08:10 +0100 |
| commit | 2092865a7e589ff805caa47e69ac9630f34d4f2a (patch) | |
| tree | 0ecdb7c4d6e22c6faa5cb64284264752a3b9c7a2 /debuginfod/debuginfod.h | |
| parent | a5cf9ba6bbdd1d565cfed671eea401ce8e6260b7 (diff) | |
| download | platform_external_elfutils-2092865a7e589ff805caa47e69ac9630f34d4f2a.tar.gz platform_external_elfutils-2092865a7e589ff805caa47e69ac9630f34d4f2a.tar.bz2 platform_external_elfutils-2092865a7e589ff805caa47e69ac9630f34d4f2a.zip | |
libelf: {de,}compress: ensure zlib resource cleanup
__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.
Fixes: 272018bba1f2 ("libelf: Add elf_compress and elf_compress_gnu.")
Signed-off-by: Matthias Maennich <maennich@google.com>
Diffstat (limited to 'debuginfod/debuginfod.h')
0 files changed, 0 insertions, 0 deletions
