From fa7da8bfad1ec2ac61859aa0b4b09b42ea657ea2 Mon Sep 17 00:00:00 2001 From: John Gallagher Date: Thu, 27 Apr 2023 23:04:31 -0700 Subject: libdwfl: Fix memory leak in unzip() state.input_buffer is not freed if the file is found to not be compressed with the compression algorithm unzip() is trying to use. Signed-off-by: John Gallagher --- libdwfl/ChangeLog | 4 ++++ libdwfl/gzip.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index daef2828..54d85921 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,7 @@ +2023-04-24 John Gallagher + + * gzip.c: Fix memory leak in unzip() + 2023-02-06 Mark Wielaard * libdwfl.h: Guard debuginfod_client typedef with diff --git a/libdwfl/gzip.c b/libdwfl/gzip.c index 53013be3..002afc4e 100644 --- a/libdwfl/gzip.c +++ b/libdwfl/gzip.c @@ -227,7 +227,7 @@ unzip (int fd, off_t start_offset, #endif ) /* Not a compressed file. */ - return DWFL_E_BADELF; + return fail (&state, DWFL_E_BADELF); #ifdef ZSTD /* special case for libzstd since it is slightly different from the -- cgit v1.2.1