2013-11-13 14:29:33

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH 1/2] android/hidhost: Fix memory leak

From: Andrei Emeltchenko <[email protected]>

---
android/hidhost.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/android/hidhost.c b/android/hidhost.c
index 910014f..ff3eae0 100644
--- a/android/hidhost.c
+++ b/android/hidhost.c
@@ -1136,6 +1136,7 @@ static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
if (err) {
error("%s", gerr->message);
g_io_channel_shutdown(chan, TRUE, NULL);
+ g_error_free(gerr);
return;
}

--
1.7.10.4



2013-11-13 14:48:15

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH 1/2] android/hidhost: Fix memory leak

Hi Andrei,

On Wed, Nov 13, 2013, Andrei Emeltchenko wrote:
> ---
> android/hidhost.c | 1 +
> 1 file changed, 1 insertion(+)

Both patches have been applied. Thanks.

Johan

2013-11-13 14:29:34

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH 2/2] android/hidhost: Use correct error structure

From: Andrei Emeltchenko <[email protected]>

---
android/hidhost.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/android/hidhost.c b/android/hidhost.c
index ff3eae0..3c1f074 100644
--- a/android/hidhost.c
+++ b/android/hidhost.c
@@ -1128,12 +1128,12 @@ static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
return;
}

- bt_io_get(chan, &err,
+ bt_io_get(chan, &gerr,
BT_IO_OPT_SOURCE_BDADDR, &src,
BT_IO_OPT_DEST_BDADDR, &dst,
BT_IO_OPT_PSM, &psm,
BT_IO_OPT_INVALID);
- if (err) {
+ if (gerr) {
error("%s", gerr->message);
g_io_channel_shutdown(chan, TRUE, NULL);
g_error_free(gerr);
--
1.7.10.4