From b193a1d61737fad7cf4b96e5fd9443b0ace36efc Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Tue, 10 Mar 2015 18:52:07 -0400 Subject: [PATCH] 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 --- src/xenapi/xenapi_driver.c | 2 ++ 1 file changed, 2 insertions(+) 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) { -- GitLab