linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anderson Lizardo <anderson.lizardo@openbossa.org>
To: Santiago Carot-Nemesio <sancane@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/2] attrib-server: Fix memory leak attaching attribute channels
Date: Tue, 7 Feb 2012 06:53:12 -0400	[thread overview]
Message-ID: <CAJdJm_PjNBaSP=nK1QitX8z0v0TtTqkBusMHRCN1DmUiFXbsKA@mail.gmail.com> (raw)
In-Reply-To: <1328607191-9550-1-git-send-email-sancane@gmail.com>

Hi Santiago,

On Tue, Feb 7, 2012 at 5:33 AM, Santiago Carot-Nemesio
<sancane@gmail.com> wrote:
> Channel is not being released when the channel is attached over
> an uninitialized GATT server.
> ---
>  src/attrib-server.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/src/attrib-server.c b/src/attrib-server.c
> index 2995167..a23d5d2 100644
> --- a/src/attrib-server.c
> +++ b/src/attrib-server.c
> @@ -1020,8 +1020,14 @@ guint attrib_channel_attach(GAttrib *attrib, gboolean out)
>        }
>
>        server = find_gatt_server(&channel->src);
> -       if (server == NULL)
> +       if (server == NULL) {
> +               char src[18];
> +
> +               ba2str(&channel->src, src);
> +               error("Not GATT server found in %s", src);

Looks ok, except for the typo: Not -> No

> +               g_free(channel);
>                return 0;
> +       }
>
>        channel->server = server;
>
> --
> 1.7.9

Best Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil

  parent reply	other threads:[~2012-02-07 10:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-07  9:33 [PATCH 1/2] attrib-server: Fix memory leak attaching attribute channels Santiago Carot-Nemesio
2012-02-07  9:33 ` [PATCH 2/2] attrib-server: Fix bad error message Santiago Carot-Nemesio
2012-02-07 10:54   ` Anderson Lizardo
2012-02-07 12:13     ` Santiago Carot
2012-02-07 10:53 ` Anderson Lizardo [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-02-07 13:26 [PATCH 1/2] attrib-server: Fix memory leak attaching attribute channels Santiago Carot-Nemesio
2012-02-08  8:21 ` Andrei Emeltchenko
2012-02-08  8:47   ` Santiago Carot
2012-02-09 10:45 ` Johan Hedberg

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='CAJdJm_PjNBaSP=nK1QitX8z0v0TtTqkBusMHRCN1DmUiFXbsKA@mail.gmail.com' \
    --to=anderson.lizardo@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=sancane@gmail.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;
as well as URLs for NNTP newsgroup(s).