From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mans Rullgard Newsgroups: gmane.comp.audio.sox.devel Subject: [PATCH] hcom: fix double free on writing zero-length file Date: Sat, 29 Aug 2015 12:38:05 +0100 Message-ID: <1440848285-17853-1-git-send-email-mans@mansr.com> Reply-To: sox-devel@lists.sourceforge.net NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1440848320 30365 80.91.229.3 (29 Aug 2015 11:38:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Aug 2015 11:38:40 +0000 (UTC) To: sox-devel@lists.sourceforge.net Original-X-From: sox-devel-bounces@lists.sourceforge.net Sat Aug 29 13:38:35 2015 Return-path: Envelope-to: gcasd-sox-devel@m.gmane.org X-ACL-Warn: X-Mailer: git-send-email 2.5.0 X-Spam-Score: -1.0 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1ZVeSp-000877-26 X-BeenThere: sox-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: sox-devel-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.comp.audio.sox.devel:417 Archived-At: Received: from lists.sourceforge.net ([216.34.181.88]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZVeSw-00036L-CP for gcasd-sox-devel@m.gmane.org; Sat, 29 Aug 2015 13:38:34 +0200 Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZVeSr-0000S4-VQ; Sat, 29 Aug 2015 11:38:29 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZVeSq-0000Rl-Jl for sox-devel@lists.sourceforge.net; Sat, 29 Aug 2015 11:38:28 +0000 Received: from unicorn.mansr.com ([81.2.72.234]) by sog-mx-4.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1ZVeSp-000877-26 for sox-devel@lists.sourceforge.net; Sat, 29 Aug 2015 11:38:28 +0000 Received: by unicorn.mansr.com (Postfix, from userid 51770) id D19CB1538A; Sat, 29 Aug 2015 12:38:20 +0100 (BST) --- 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 ------------------------------------------------------------------------------