Skip to content

Commit

Permalink
xen-block: Fix uninitialized variable
Browse files Browse the repository at this point in the history
Since 7f5d9b2 ("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: 5f07c4d ("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>
  • Loading branch information
anthonyper-ctx committed Apr 7, 2020
1 parent 1aef27c commit 0cd4004
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/block/xen-block.c
Expand Up @@ -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);

Expand Down

0 comments on commit 0cd4004

Please sign in to comment.