]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuDiskSourceGetProps: Initialize 'ret'
authorPeter Krempa <pkrempa@redhat.com>
Tue, 9 Nov 2021 12:29:43 +0000 (13:29 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 17 Nov 2021 11:04:11 +0000 (12:04 +0100)
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>
src/qemu/qemu_command.c

index 17ff7a5fe277204067d3d39870fa99c3eeae03e0..e63e82e26142df695cc2a8c6d85c1b91d48acf64 100644 (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)))