cpu-plug-test: fix leaks

Spotted by ASAN.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20191107192731.17330-4-marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Fixes: 021a007efc ("cpu-plug-test: fix device_add for pc/q35 machines")
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Marc-André Lureau 2019-11-07 23:27:31 +04:00 committed by Thomas Huth
parent 36524a1a3d
commit 741309136e
1 changed files with 2 additions and 0 deletions

View File

@ -99,6 +99,7 @@ static void test_plug_with_device_add(gconstpointer data)
cpu = qobject_to(QDict, e);
if (qdict_haskey(cpu, "qom-path")) {
qobject_unref(e);
continue;
}
@ -107,6 +108,7 @@ static void test_plug_with_device_add(gconstpointer data)
qtest_qmp_device_add_qdict(qts, td->device_model, props);
hotplugged++;
qobject_unref(e);
}
/* make sure that there were hotplugged CPUs */