Commit 0cd40042 authored by Anthony PERARD's avatar Anthony PERARD
Browse files

xen-block: Fix uninitialized variable



Since 7f5d9b20 ("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: 5f07c4d6 ("qapi: Flatten object-add")
Signed-off-by: default avatarAnthony PERARD <anthony.perard@citrix.com>
Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
Message-Id: <20200406164207.1446817-1-anthony.perard@citrix.com>
parent 1aef27c9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);