aboutsummaryrefslogtreecommitdiff
path: root/tests/test-keyval.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-05-04 02:38:42 +0400
committerMarkus Armbruster <armbru@redhat.com>2017-05-08 20:32:14 +0200
commitcb69166bb8defaaa4b3e0a4e31de693737634a54 (patch)
tree0fdf991b2b89dac24c5d1372d634c0e30f867220 /tests/test-keyval.c
parentde4598f0c5a734863f74b7984604bfb8a89fbccd (diff)
test-keyval: fix leaks
Spotted by ASAN. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170503223846.6559-2-marcandre.lureau@redhat.com> Reviewed-by: Eric blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/test-keyval.c')
-rw-r--r--tests/test-keyval.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test-keyval.c b/tests/test-keyval.c
index ba19560a22..c556b1b117 100644
--- a/tests/test-keyval.c
+++ b/tests/test-keyval.c
@@ -628,6 +628,7 @@ static void test_keyval_visit_alternate(void)
visit_type_AltNumStr(v, "a", &ans, &error_abort);
g_assert_cmpint(ans->type, ==, QTYPE_QSTRING);
g_assert_cmpstr(ans->u.s, ==, "1");
+ qapi_free_AltNumStr(ans);
visit_type_AltNumInt(v, "a", &ani, &err);
error_free_or_abort(&err);
visit_end_struct(v, NULL);
@@ -651,9 +652,12 @@ static void test_keyval_visit_any(void)
g_assert(qlist);
qstr = qobject_to_qstring(qlist_pop(qlist));
g_assert_cmpstr(qstring_get_str(qstr), ==, "null");
+ QDECREF(qstr);
qstr = qobject_to_qstring(qlist_pop(qlist));
g_assert_cmpstr(qstring_get_str(qstr), ==, "1");
g_assert(qlist_empty(qlist));
+ QDECREF(qstr);
+ qobject_decref(any);
visit_check_struct(v, &error_abort);
visit_end_struct(v, NULL);
visit_free(v);