From: Szymon Janc <szymon.janc@gmail.com>
To: Marcin Kraglak <marcin.kraglak@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/2] android/gatt: Fix possible memory leak in write request
Date: Tue, 27 May 2014 00:14:21 +0200 [thread overview]
Message-ID: <11034349.R0bk4YHB4h@athlon> (raw)
In-Reply-To: <1401113183-6617-1-git-send-email-marcin.kraglak@tieto.com>
Hi Marcin,
On Monday 26 May 2014 16:06:22 Marcin Kraglak wrote:
> If write cannot be executed, remove data from queue and free
> allocated memory.
> ---
> android/gatt.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/android/gatt.c b/android/gatt.c
> index e41a69e..721785a 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -4969,8 +4969,11 @@ static uint8_t write_req_request(const uint8_t *cmd,
> uint16_t cmd_len, }
>
> if (!gatt_db_write(gatt_db, handle, 0, value, vlen, cmd[0],
> - &dev->bdaddr))
> + &dev->bdaddr)) {
> + queue_remove(dev->pending_requests, data);
> + free(data);
> return ATT_ECODE_UNLIKELY;
> + }
>
> return 0;
> }
Both patches applied, thanks.
--
Szymon K. Janc
szymon.janc@gmail.com
prev parent reply other threads:[~2014-05-26 22:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-26 14:06 [PATCH 1/2] android/gatt: Fix possible memory leak in write request Marcin Kraglak
2014-05-26 14:06 ` [PATCH 2/2] android/gatt: Check permissions before write execution Marcin Kraglak
2014-05-26 22:14 ` 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=11034349.R0bk4YHB4h@athlon \
--to=szymon.janc@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcin.kraglak@tieto.com \
/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