This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 11/19] libctf: fix memory leak on ctf_compress_write error path
- From: Nick Alcock <nick dot alcock at oracle dot com>
- To: binutils at sourceware dot org
- Cc: elena dot zannoni at oracle dot com, jose dot marchesi at oracle dot com, indu dot bhagat at oracle dot com, egeyar dot bagcioglu at oracle dot com
- Date: Tue, 16 Jul 2019 19:04:12 +0100
- Subject: [PATCH 11/19] libctf: fix memory leak on ctf_compress_write error path
- References: <20190716180420.236506-1-nick.alcock@oracle.com>
We were failing to free the compressed-data buffer if compression
failed.
libctf/
* ctf-create.c (ctf_compress_write): Fix leak.
---
libctf/ctf-create.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/libctf/ctf-create.c b/libctf/ctf-create.c
index 5b6cc8b597..2e05649d4a 100644
--- a/libctf/ctf-create.c
+++ b/libctf/ctf-create.c
@@ -1980,7 +1980,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;
}
--
2.22.0.238.g049a27acdc