From: Szymon Janc <szymon.janc@tieto.com>
To: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] shared/gap: Fix memory leak in gap
Date: Fri, 19 Dec 2014 13:29:39 +0100 [thread overview]
Message-ID: <3389986.jiWvF7HSzQ@uw000953> (raw)
In-Reply-To: <1418991181-3826-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
Hi Andrei,
On Friday 19 of December 2014 14:13:01 Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>
> Allocated irk memory was never assigned.
> ---
> src/shared/gap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/shared/gap.c b/src/shared/gap.c
> index 19059e8..3536c1c 100644
> --- a/src/shared/gap.c
> +++ b/src/shared/gap.c
> @@ -276,5 +276,5 @@ bool bt_gap_add_peer_irk(struct bt_gap *gap, uint8_t addr_type,
> memcpy(irk->addr, addr, 6);
> memcpy(irk->key, key, 16);
>
> - return true;
> + return queue_push_tail(gap->irk_list, irk);
> }
For sanity this should free irk if push failed.
--
Best regards,
Szymon Janc
next prev parent reply other threads:[~2014-12-19 12:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-19 12:13 [PATCH] shared/gap: Fix memory leak in gap Andrei Emeltchenko
2014-12-19 12:29 ` Szymon Janc [this message]
2014-12-19 12:43 ` Andrei Emeltchenko
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=3389986.jiWvF7HSzQ@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