From: Eric Wong <normalperson@yhbt.net>
To: sox-devel@lists.sourceforge.net
Subject: Re: [PATCH] hcom: fix double free on writing zero-length file
Date: Mon, 7 Sep 2015 01:05:36 +0000 [thread overview]
Message-ID: <20150907010536.GA9338@dcvr.yhbt.net> (raw)
In-Reply-To: <1440848285-17853-1-git-send-email-mans@mansr.com>
Mans Rullgard <mans@mansr.com> wrote:
> +++ 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);
> + }
Tested successfully with: sox $INPUT x.hcom trim 0
A side note: As somebody who has never heard of hcom until now, much
less read the code, it was not immediately obvious to me what the
problem was or whether it introduced a new leaks until I skimmed through
the entire stopwrite and compress functions :x
------------------------------------------------------------------------------
prev parent reply other threads:[~2015-09-07 1:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-29 11:38 [PATCH] hcom: fix double free on writing zero-length file Mans Rullgard
2015-09-07 1:05 ` Eric Wong [this message]
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=20150907010536.GA9338@dcvr.yhbt.net \
--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).