2014-02-12 14:22:07

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH] android: Fix memory leak: uuid free

From: Andrei Emeltchenko <[email protected]>

Free uuid before exiting.
---
android/bluetooth.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/android/bluetooth.c b/android/bluetooth.c
index 5de3401..b818e88 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -1557,6 +1557,8 @@ int bt_adapter_add_record(sdp_record_t *rec, uint8_t svc_hint)

sdp_uuid2strn(uuid, uuid_str, sizeof(uuid_str));
DBG("UUID %s already added", uuid_str);
+
+ bt_free(uuid);
return -EALREADY;
}

--
1.8.3.2



2014-02-14 10:36:28

by Szymon Janc

[permalink] [raw]
Subject: Re: [PATCH] android: Fix memory leak: uuid free

Hi Andrei,

On Wednesday 12 of February 2014 16:22:07 Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <[email protected]>
>
> Free uuid before exiting.
> ---
> android/bluetooth.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/android/bluetooth.c b/android/bluetooth.c
> index 5de3401..b818e88 100644
> --- a/android/bluetooth.c
> +++ b/android/bluetooth.c
> @@ -1557,6 +1557,8 @@ int bt_adapter_add_record(sdp_record_t *rec, uint8_t svc_hint)
>
> sdp_uuid2strn(uuid, uuid_str, sizeof(uuid_str));
> DBG("UUID %s already added", uuid_str);
> +
> + bt_free(uuid);
> return -EALREADY;
> }

Applied, thanks.

--
Best regards,
Szymon Janc

2014-02-14 09:01:38

by Andrei Emeltchenko

[permalink] [raw]
Subject: Re: [PATCH] android: Fix memory leak: uuid free

On Wed, Feb 12, 2014 at 04:22:07PM +0200, Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <[email protected]>
>
> Free uuid before exiting.

ping

> ---
> android/bluetooth.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/android/bluetooth.c b/android/bluetooth.c
> index 5de3401..b818e88 100644
> --- a/android/bluetooth.c
> +++ b/android/bluetooth.c
> @@ -1557,6 +1557,8 @@ int bt_adapter_add_record(sdp_record_t *rec, uint8_t svc_hint)
>
> sdp_uuid2strn(uuid, uuid_str, sizeof(uuid_str));
> DBG("UUID %s already added", uuid_str);
> +
> + bt_free(uuid);
> return -EALREADY;
> }
>
> --
> 1.8.3.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html