[v4,11/35,CHANGED] libctf: fix double-free on ctf_compress_write error path

Message ID 20190924135131.441906-12-nick.alcock@oracle.com
State New
Headers show
Series
  • CTF linking support
Related show

Commit Message

Nick Alcock Sept. 24, 2019, 1:51 p.m.
We were freeing the compressed data buffer twice if compression failed.

v4: Fix commit message.

libctf/
	* ctf-create.c (ctf_compress_write): Fix double-free.
---
 libctf/ctf-create.c | 1 -
 1 file changed, 1 deletion(-)

-- 
2.23.0.239.g28aa4420fd

Patch

diff --git a/libctf/ctf-create.c b/libctf/ctf-create.c
index 6189042fdb0..76304f724c7 100644
--- a/libctf/ctf-create.c
+++ b/libctf/ctf-create.c
@@ -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;
     }