Linux bluetooth development
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org,
	Bruna Moreira <bruna.moreira@openbossa.org>
Subject: Re: [PATCH v3 2/4] Advertising data: extract local name
Date: Mon, 15 Nov 2010 14:07:59 +0000	[thread overview]
Message-ID: <20101115140759.GB11936@jh-x301> (raw)
In-Reply-To: <1289518769-3009-2-git-send-email-vinicius.gomes@openbossa.org>

Hi,

On Thu, Nov 11, 2010, Vinicius Costa Gomes wrote:
> @@ -3159,6 +3160,12 @@ void adapter_update_device_from_info(struct btd_adapter *adapter,
>  
>  	adapter->found_devices = g_slist_sort(adapter->found_devices,
>  						(GCompareFunc) dev_rssi_cmp);
> +
> +	if (info->length) {
> +		char *tmp_name = bt_extract_eir_name(info->data, &type);
> +		if (tmp_name)
> +			dev->name = tmp_name;
> +	}
>  }

This looks like a potential memory leak to me. What if dev->name was
already set (e.g. by a previous event for the same device)?

Johan

  reply	other threads:[~2010-11-15 14:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-11 23:39 [PATCH v3 1/4] Initial advertising data parsing implementation Vinicius Costa Gomes
2010-11-11 23:39 ` [PATCH v3 2/4] Advertising data: extract local name Vinicius Costa Gomes
2010-11-15 14:07   ` Johan Hedberg [this message]
2010-11-11 23:39 ` [PATCH v3 3/4] Extract service UUIDs from advertising data Vinicius Costa Gomes
2010-11-11 23:39 ` [PATCH v3 4/4] Emit "DeviceFound" signal for LE devices Vinicius Costa Gomes
2010-11-15 14:05 ` [PATCH v3 1/4] Initial advertising data parsing implementation 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=20101115140759.GB11936@jh-x301 \
    --to=johan.hedberg@gmail.com \
    --cc=bruna.moreira@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=vinicius.gomes@openbossa.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