Skip to content

Commit 0cd4004

Browse files
xen-block: Fix uninitialized variable
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 <[email protected]> Reviewed-by: Markus Armbruster <[email protected]> Message-Id: <[email protected]>
1 parent 1aef27c commit 0cd4004

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hw/block/xen-block.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ static XenBlockIOThread *xen_block_iothread_create(const char *id,
860860
XenBlockIOThread *iothread = g_new(XenBlockIOThread, 1);
861861
Error *local_err = NULL;
862862
QDict *opts;
863-
QObject *ret_data;
863+
QObject *ret_data = NULL;
864864

865865
iothread->id = g_strdup(id);
866866

0 commit comments

Comments
 (0)