[jsonrpc-glib] tests: don't leak return value
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jsonrpc-glib] tests: don't leak return value
- Date: Wed, 27 Dec 2017 11:38:50 +0000 (UTC)
commit 223d8428b321a1d806335291b689a02168c2a473
Author: Christian Hergert <chergert redhat com>
Date: Wed Dec 27 03:07:14 2017 -0800
tests: don't leak return value
Fixes warning from ASAN when running tests.
tests/test-server.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/tests/test-server.c b/tests/test-server.c
index a4bfc3d..765253c 100644
--- a/tests/test-server.c
+++ b/tests/test-server.c
@@ -178,6 +178,7 @@ test_basic (gboolean use_gvariant)
g_assert_no_error (error);
g_assert_cmpint (r, ==, TRUE);
g_assert (return_value != NULL);
+ g_clear_pointer (&return_value, g_variant_unref);
g_assert_cmpint (count, ==, 1);
@@ -200,6 +201,7 @@ test_basic (gboolean use_gvariant)
g_assert_no_error (error);
g_assert_cmpint (r, ==, TRUE);
g_assert (return_value != NULL);
+ g_clear_pointer (&return_value, g_variant_unref);
g_assert_cmpint (count, ==, 2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]