]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdwfl: Fix memory leak in unzip()
authorJohn Gallagher <john@gllghr.com>
Fri, 28 Apr 2023 06:04:31 +0000 (23:04 -0700)
committerMark Wielaard <mark@klomp.org>
Mon, 8 May 2023 15:46:00 +0000 (17:46 +0200)
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 <john@gllghr.com>
libdwfl/ChangeLog
libdwfl/gzip.c

index daef28285946e32be0ec839529737d08a710ced9..54d859214ce849fa9215128a07fc8177a2b16d62 100644 (file)
@@ -1,3 +1,7 @@
+2023-04-24  John Gallagher  <john@gllghr.com>
+
+       * gzip.c: Fix memory leak in unzip()
+
 2023-02-06  Mark Wielaard  <mark@klomp.org>
 
        * libdwfl.h: Guard debuginfod_client typedef with
index 53013be3cce440e3995051223f0e810888611f77..002afc4e916b91217072b51c218c7b4a16e8d50b 100644 (file)
@@ -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