]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
xen-block: Fix uninitialized variable
authorAnthony PERARD <anthony.perard@citrix.com>
Mon, 6 Apr 2020 16:42:07 +0000 (17:42 +0100)
committerAnthony PERARD <anthony.perard@citrix.com>
Tue, 7 Apr 2020 15:13:26 +0000 (16:13 +0100)
Since 7f5d9b206d1e ("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: 5f07c4d60d09 ("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>

hw/block/xen-block.c

index 07bb32e22b51ba8e211fc3bb58be48d8d7740eb3..99cb4c67cb09aa2bd8f12982984fc4560cc20aba 100644 (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);