libctf: fix double-free on ctf_compress_write error path

We were freeing the compressed data buffer twice if compression failed.

v4: Fix commit message.
v5: fix tabdamage.

libctf/
	* ctf-create.c (ctf_compress_write): Fix double-free.
This commit is contained in:
Nick Alcock 2019-07-13 20:44:38 +01:00
parent 5537f9b9a3
commit 3dde2c915e
2 changed files with 4 additions and 1 deletions

View 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;
}