qemuDiskSourceGetProps: Initialize 'ret'

Upcomming patch will convert virJSONValueObjectCreate which didn't check
the value of the passed argument to virJSONValueObjectAdd which will and
this would lead to crashes.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2021-11-09 13:29:43 +01:00
parent dd45aad40a
commit fdda016bce

View File

@ -1616,7 +1616,7 @@ static virJSONValue *
qemuDiskSourceGetProps(virStorageSource *src)
{
g_autoptr(virJSONValue) props = NULL;
virJSONValue *ret;
virJSONValue *ret = NULL;
if (!(props = qemuBlockStorageSourceGetBackendProps(src,
QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_LEGACY)))