mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
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:
parent
5d8c31c6b2
commit
8ad7eceb20
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user