Return-Path: From: Szymon Janc To: Andrei Emeltchenko Cc: linux-bluetooth@vger.kernel.org Subject: Re: [PATCH] hfp: Fix memory leak Date: Thu, 30 Oct 2014 10:30:28 +0100 Message-ID: <24392477.JhYW2PpoS6@leonov> In-Reply-To: <1414502910-19950-1-git-send-email-Andrei.Emeltchenko.news@gmail.com> References: <1414502910-19950-1-git-send-email-Andrei.Emeltchenko.news@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Andrei, On Tuesday 28 of October 2014 15:28:30 Andrei Emeltchenko wrote: > From: Andrei Emeltchenko > > Free fmt allocated by asprintf(). > --- > src/shared/hfp.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/src/shared/hfp.c b/src/shared/hfp.c > index 22e9622..9a66ed2 100644 > --- a/src/shared/hfp.c > +++ b/src/shared/hfp.c > @@ -1321,8 +1321,10 @@ bool hfp_hf_send_command(struct hfp_hf *hfp, > hfp_response_func_t resp_cb, return false; > > cmd = new0(struct cmd_response, 1); > - if (!cmd) > + if (!cmd) { > + free(fmt); > return false; > + } > > va_start(ap, format); > len = ringbuf_vprintf(hfp->write_buf, fmt, ap); Patch applied after fixing commit prefix, thanks. -- BR Szymon Janc