xen-block: Fix uninitialized variable

Since 7f5d9b206d ("object-add: don't create return value if
failed"), qmp_object_add() don't write any value in 'ret_data', thus
has random data. Then qobject_unref() fails and abort().

Fix by initialising 'ret_data' properly.

Fixes: 5f07c4d60d ("qapi: Flatten object-add")
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200406164207.1446817-1-anthony.perard@citrix.com>
This commit is contained in:
Anthony PERARD 2020-04-06 17:42:07 +01:00
parent 1aef27c93d
commit 0cd40042c5

View File

@ -860,7 +860,7 @@ static XenBlockIOThread *xen_block_iothread_create(const char *id,
XenBlockIOThread *iothread = g_new(XenBlockIOThread, 1);
Error *local_err = NULL;
QDict *opts;
QObject *ret_data;
QObject *ret_data = NULL;
iothread->id = g_strdup(id);