From: John Ferlan Date: Thu, 4 Sep 2014 20:22:07 +0000 (-0400) Subject: lxc: Resolve Coverity FORWARD_NULL X-Git-Tag: CVE-2014-3633~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0311be9435087984c495243fbb378b7533beb99e;p=thirdparty%2Flibvirt.git lxc: Resolve Coverity FORWARD_NULL If we jump to cleanup before allocating 'result', then the call to virBlkioDeviceArrayClear() could dereference result Signed-off-by: John Ferlan --- diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index f93360feb6..e5b6662fdb 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -2222,8 +2222,10 @@ lxcDomainParseBlkioDeviceStr(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; }