From: John Ferlan Date: Thu, 4 Sep 2014 20:24:37 +0000 (-0400) Subject: qemu: Resolve Coverity FORWARD_NULL X-Git-Tag: CVE-2014-3633~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f28a31fcc42ec82fc60e409afd7d2f2220ae9d2d;p=thirdparty%2Flibvirt.git qemu: Resolve Coverity FORWARD_NULL If we jump to cleanup before allocating the 'result', then the call to virBlkioDeviceArrayClear will deref result causing a problem. Signed-off-by: John Ferlan --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b47d00f91a..78b8a82607 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -7683,8 +7683,10 @@ qemuDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, _("unable to parse blkio device '%s' '%s'"), type, blkioDeviceStr); cleanup: - virBlkioDeviceArrayClear(result, ndevices); - VIR_FREE(result); + if (result) { + virBlkioDeviceArrayClear(result, ndevices); + VIR_FREE(result); + } return -1; }