aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-07-14 04:27:20 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2016-09-08 18:05:21 +0400
commitff1685a3338072be9a94ab8a8f529c12e4265224 (patch)
treef1e2f2bedeab7230b9a3e313ded9e2adfd6ac655 /tests
parent354fb471bd5faf527f3fa25388b8cffa6bd937d0 (diff)
tests: fix qom-test leaks
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/qom-test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/qom-test.c b/tests/qom-test.c
index 23493a2b0a..d48f890e84 100644
--- a/tests/qom-test.c
+++ b/tests/qom-test.c
@@ -115,7 +115,7 @@ static void add_machine_test_cases(void)
const QListEntry *p;
QObject *qobj;
QString *qstr;
- const char *mname, *path;
+ const char *mname;
qtest_start("-machine none");
response = qmp("{ 'execute': 'query-machines' }");
@@ -132,8 +132,9 @@ static void add_machine_test_cases(void)
g_assert(qstr);
mname = qstring_get_str(qstr);
if (!is_blacklisted(arch, mname)) {
- path = g_strdup_printf("qom/%s", mname);
+ char *path = g_strdup_printf("qom/%s", mname);
qtest_add_data_func(path, g_strdup(mname), test_machine);
+ g_free(path);
}
}