From: Szymon Janc <szymon.janc@tieto.com>
To: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] android/core: Fix memory leak in parse_system_id()
Date: Thu, 02 Oct 2014 16:47:32 +0200 [thread overview]
Message-ID: <4430593.SCUzDF85ib@uw000953> (raw)
In-Reply-To: <1412260297-6200-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
Hi Andrei,
On Thursday 02 of October 2014 17:31:37 Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>
> get_prop() allocates memory which needs to be freed.
> ---
> android/main.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/android/main.c b/android/main.c
> index 4f3a6bf..703b3b6 100644
> --- a/android/main.c
> +++ b/android/main.c
> @@ -382,9 +382,11 @@ static void parse_system_id(uint16_t len, const uint8_t *val)
>
> res = strtoull(id, NULL, 16);
> if (res == ULLONG_MAX && errno == ERANGE)
> - return;
> + goto done;
>
> config_system_id = res;
> +done:
> + free(id);
> }
>
> static void configuration(const void *buf, uint16_t len)
>
Patch applied, thanks.
--
Best regards,
Szymon Janc
prev parent reply other threads:[~2014-10-02 14:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-02 14:31 [PATCH] android/core: Fix memory leak in parse_system_id() Andrei Emeltchenko
2014-10-02 14:47 ` Szymon Janc [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-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4430593.SCUzDF85ib@uw000953 \
--to=szymon.janc@tieto.com \
--cc=Andrei.Emeltchenko.news@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox