2014-02-11 18:16:31

by Anderson Lizardo

[permalink] [raw]
Subject: [PATCH BlueZ] unit: Fix memory leaks in gobex tests

---
unit/test-gobex-apparam.c | 2 ++
unit/test-gobex-transfer.c | 2 ++
2 files changed, 4 insertions(+)

diff --git a/unit/test-gobex-apparam.c b/unit/test-gobex-apparam.c
index e6a42cc..976c541 100644
--- a/unit/test-gobex-apparam.c
+++ b/unit/test-gobex-apparam.c
@@ -250,6 +250,8 @@ static void test_apparam_get_multi(void)
g_assert(string != NULL);
g_assert_cmpstr(string, ==, "ABC");

+ g_free(string);
+
g_obex_apparam_free(apparam);
}

diff --git a/unit/test-gobex-transfer.c b/unit/test-gobex-transfer.c
index 128a467..7c9fd43 100644
--- a/unit/test-gobex-transfer.c
+++ b/unit/test-gobex-transfer.c
@@ -511,6 +511,7 @@ static void test_stream_put_req_abort(void)
g_obex_unref(obex);

g_assert_error(d.err, G_OBEX_ERROR, G_OBEX_ERROR_CANCELLED);
+ g_error_free(d.err);
}

static void test_stream_put_rsp_abort(void)
@@ -556,6 +557,7 @@ static void test_stream_put_rsp_abort(void)
g_obex_unref(obex);

g_assert_error(d.err, G_OBEX_ERROR, G_OBEX_ERROR_CANCELLED);
+ g_error_free(d.err);
}

static void handle_put_seq_wait(GObex *obex, GObexPacket *req,
--
1.7.9.5



2014-02-12 09:53:50

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH BlueZ] unit: Fix memory leaks in gobex tests

Hi Anderson,

On Tue, Feb 11, 2014 at 8:16 PM, Anderson Lizardo
<[email protected]> wrote:
> ---
> unit/test-gobex-apparam.c | 2 ++
> unit/test-gobex-transfer.c | 2 ++
> 2 files changed, 4 insertions(+)
>
> diff --git a/unit/test-gobex-apparam.c b/unit/test-gobex-apparam.c
> index e6a42cc..976c541 100644
> --- a/unit/test-gobex-apparam.c
> +++ b/unit/test-gobex-apparam.c
> @@ -250,6 +250,8 @@ static void test_apparam_get_multi(void)
> g_assert(string != NULL);
> g_assert_cmpstr(string, ==, "ABC");
>
> + g_free(string);
> +
> g_obex_apparam_free(apparam);
> }
>
> diff --git a/unit/test-gobex-transfer.c b/unit/test-gobex-transfer.c
> index 128a467..7c9fd43 100644
> --- a/unit/test-gobex-transfer.c
> +++ b/unit/test-gobex-transfer.c
> @@ -511,6 +511,7 @@ static void test_stream_put_req_abort(void)
> g_obex_unref(obex);
>
> g_assert_error(d.err, G_OBEX_ERROR, G_OBEX_ERROR_CANCELLED);
> + g_error_free(d.err);
> }
>
> static void test_stream_put_rsp_abort(void)
> @@ -556,6 +557,7 @@ static void test_stream_put_rsp_abort(void)
> g_obex_unref(obex);
>
> g_assert_error(d.err, G_OBEX_ERROR, G_OBEX_ERROR_CANCELLED);
> + g_error_free(d.err);
> }
>
> static void handle_put_seq_wait(GObex *obex, GObexPacket *req,
> --
> 1.7.9.5

Applied, thanks.


--
Luiz Augusto von Dentz