qemu: Need to free fileprops in error path

The virJSONValueObjectCreate only consumes the object on success, so on
failure we must free - from commit id 'f4441017' (found by Coverity).
This commit is contained in:
John Ferlan 2016-07-28 09:25:40 -04:00
parent 5d8c31c6b2
commit 8ad7eceb20

View File

@ -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;
}