]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
libctf: fix double-free on ctf_compress_write error path
authorNick Alcock <nick.alcock@oracle.com>
Sat, 13 Jul 2019 19:44:38 +0000 (20:44 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Mon, 23 Sep 2019 13:12:54 +0000 (14:12 +0100)
We were freeing the compressed data buffer twice if compression failed.

libctf/
* ctf-create.c (ctf_compress_write): Fix double-free.

libctf/ChangeLog
libctf/ctf-create.c

index bb75f9d6423ed6d079cbcf57979c93065db18eeb..1315f4dc384fd40d34ac6989b478275c3c548c00 100644 (file)
@@ -1,3 +1,7 @@
+2019-07-13  Nick Alcock  <nick.alcock@oracle.com>
+
+       * ctf-create.c (ctf_compress_write): Fix double-free.
+
 2019-07-13  Nick Alcock  <nick.alcock@oracle.com>
 
        * ctf-archive.c (ctf_arc_write): Split off, and reimplement in terms
index 6189042fdb01865a9c320340cf1843ec0772d783..76304f724c76cd039c644145b5f973ff07ff5b0f 100644 (file)
@@ -1997,7 +1997,6 @@ ctf_compress_write (ctf_file_t *fp, int fd)
     {
       ctf_dprintf ("zlib deflate err: %s\n", zError (rc));
       err = ctf_set_errno (fp, ECTF_COMPRESS);
-      ctf_free (buf);
       goto ret;
     }