From: John Ferlan Date: Thu, 28 Jul 2016 13:25:40 +0000 (-0400) Subject: qemu: Need to free fileprops in error path X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=8ad7eceb20b2c08b09689b2c2ab755fc7d0acf16;p=libvirt.git 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). --- 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; }