sox-devel@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
From: Mans Rullgard <mans@mansr.com>
To: sox-devel@lists.sourceforge.net
Subject: [PATCH] hcom: fix double free on writing zero-length file
Date: Sat, 29 Aug 2015 12:38:05 +0100	[thread overview]
Message-ID: <1440848285-17853-1-git-send-email-mans@mansr.com> (raw)

---
 src/hcom.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/hcom.c b/src/hcom.c
index e76820e..c62b020 100644
--- a/src/hcom.c
+++ b/src/hcom.c
@@ -432,9 +432,10 @@ static int stopwrite(sox_format_t * ft)
   int rc = SOX_SUCCESS;
 
   /* Compress it all at once */
-  if (compressed_len)
+  if (compressed_len) {
     compress(ft, &compressed_data, (int32_t *)&compressed_len);
-  free(p->data);
+    free(p->data);
+  }
 
   /* Write the header */
   lsx_writebuf(ft, "\000\001A", (size_t) 3); /* Dummy file name "A" */
-- 
2.5.0


------------------------------------------------------------------------------

             reply	other threads:[~2015-08-29 11:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-29 11:38 Mans Rullgard [this message]
2015-09-07  1:05 ` [PATCH] hcom: fix double free on writing zero-length file Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.sourceforge.net/lists/listinfo/sox-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440848285-17853-1-git-send-email-mans@mansr.com \
    --to=sox-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).