From: John Ferlan Date: Tue, 10 Mar 2015 22:52:07 +0000 (-0400) Subject: xenapi: Resolve Coverity NULL_RETURNS X-Git-Tag: v1.2.14-rc1~182 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b193a1d61737fad7cf4b96e5fd9443b0ace36efc;p=thirdparty%2Flibvirt.git xenapi: Resolve Coverity NULL_RETURNS Coverity points out that the return from virDomainDefParseString is not checked in xenapiDomainCreateXML like it should be which could end up in a NULL pointer dereference --- diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c index 821e9d94ce..148ff9bd8c 100644 --- a/src/xenapi/xenapi_driver.c +++ b/src/xenapi/xenapi_driver.c @@ -560,6 +560,8 @@ xenapiDomainCreateXML(virConnectPtr conn, priv->caps, priv->xmlopt, 1 << VIR_DOMAIN_VIRT_XEN, parse_flags); + if (!defPtr) + return NULL; createVMRecordFromXml(conn, defPtr, &record, &vm); virDomainDefFree(defPtr); if (record) {