]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
qtest: fix qtest_qmp_device_add leak
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 7 Nov 2019 19:27:30 +0000 (23:27 +0400)
committerThomas Huth <thuth@redhat.com>
Mon, 11 Nov 2019 12:01:46 +0000 (13:01 +0100)
Spotted by ASAN.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20191107192731.17330-3-marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Fixes: b4510bb4109f5f ("tests: add qtest_qmp_device_add_qdict() helper")
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/libqtest.c

index 3706bccd8d50e6dd3c3acd36e574e7eb500df221..91e9cb220c59caf8bb35b057d346cd82f78ab7ae 100644 (file)
@@ -1274,6 +1274,7 @@ void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id,
     qdict_put_str(args, "id", id);
 
     qtest_qmp_device_add_qdict(qts, driver, args);
+    qobject_unref(args);
 }
 
 static void device_deleted_cb(void *opaque, const char *name, QDict *data)