diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0094665ca1..c4da8b594a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1038,8 +1038,10 @@ qemuGetDriveSourceProps(virStorageSourcePtr src, } if (fileprops && - virJSONValueObjectCreate(props, "a:file", fileprops, NULL) < 0) + virJSONValueObjectCreate(props, "a:file", fileprops, NULL) < 0) { + virJSONValueFree(fileprops); return -1; + } return 0; }