diff options
author | Anthony PERARD | 2020-04-06 18:42:07 +0200 |
---|---|---|
committer | Anthony PERARD | 2020-04-07 17:13:26 +0200 |
commit | 0cd40042c53a78057f4811379207ad9f141af703 (patch) | |
tree | 0765177ae22984277c5161156c43a12cb9c7bede /hw | |
parent | hw/usb/xen-usb.c: Pass struct usbback_req* to usbback_packet_complete() (diff) | |
download | qemu-0cd40042c53a78057f4811379207ad9f141af703.tar.gz qemu-0cd40042c53a78057f4811379207ad9f141af703.tar.xz qemu-0cd40042c53a78057f4811379207ad9f141af703.zip |
xen-block: Fix uninitialized variable
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>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/block/xen-block.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index 07bb32e22b..99cb4c67cb 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -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); |