diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-05-26 15:04:55 +0400 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2017-05-30 16:09:48 -0300 |
commit | 5e39d89d20b17cf6fb7f09d181d34f17b2ae2160 (patch) | |
tree | eed879edaa783e7da1484e9a80195444e9cf7073 /tests | |
parent | 0748b3526e8cb78b9cd64208426bfc3d54a72b04 (diff) | |
download | qemu-5e39d89d20b17cf6fb7f09d181d34f17b2ae2160.zip qemu-5e39d89d20b17cf6fb7f09d181d34f17b2ae2160.tar.gz qemu-5e39d89d20b17cf6fb7f09d181d34f17b2ae2160.tar.bz2 |
numa-test: fix query-cpus leaks
Fix test leaks introduced in commit 2941020a476.
(and small extra space removed)
Spotted by ASAN.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20170526110456.32004-1-marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/numa-test.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/numa-test.c b/tests/numa-test.c index c3475d6..3f63684 100644 --- a/tests/numa-test.c +++ b/tests/numa-test.c @@ -92,7 +92,7 @@ static QList *get_cpus(QDict **resp) *resp = qmp("{ 'execute': 'query-cpus' }"); g_assert(*resp); g_assert(qdict_haskey(*resp, "return")); - return qdict_get_qlist(*resp, "return"); + return qdict_get_qlist(*resp, "return"); } static void test_query_cpus(const void *data) @@ -100,7 +100,7 @@ static void test_query_cpus(const void *data) char *cli; QDict *resp; QList *cpus; - const QObject *e; + QObject *e; cli = make_cli(data, "-smp 8 -numa node,cpus=0-3 -numa node,cpus=4-7"); qtest_start(cli); @@ -124,6 +124,7 @@ static void test_query_cpus(const void *data) } else { g_assert_cmpint(node, ==, 1); } + qobject_decref(e); } QDECREF(resp); @@ -136,7 +137,7 @@ static void pc_numa_cpu(const void *data) char *cli; QDict *resp; QList *cpus; - const QObject *e; + QObject *e; cli = make_cli(data, "-cpu pentium -smp 8,sockets=2,cores=2,threads=2 " "-numa node,nodeid=0 -numa node,nodeid=1 " @@ -176,6 +177,7 @@ static void pc_numa_cpu(const void *data) } else { g_assert(false); } + qobject_decref(e); } QDECREF(resp); @@ -188,7 +190,7 @@ static void spapr_numa_cpu(const void *data) char *cli; QDict *resp; QList *cpus; - const QObject *e; + QObject *e; cli = make_cli(data, "-smp 4,cores=4 " "-numa node,nodeid=0 -numa node,nodeid=1 " @@ -220,6 +222,7 @@ static void spapr_numa_cpu(const void *data) } else { g_assert(false); } + qobject_decref(e); } QDECREF(resp); @@ -232,7 +235,7 @@ static void aarch64_numa_cpu(const void *data) char *cli; QDict *resp; QList *cpus; - const QObject *e; + QObject *e; cli = make_cli(data, "-smp 2 " "-numa node,nodeid=0 -numa node,nodeid=1 " @@ -262,6 +265,7 @@ static void aarch64_numa_cpu(const void *data) } else { g_assert(false); } + qobject_decref(e); } QDECREF(resp); |