mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-27 23:15:18 +00:00
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 (cherry picked from commit b193a1d61737fad7cf4b96e5fd9443b0ace36efc)
This commit is contained in:
parent
2f26dccb65
commit
e4afc2a29d
@ -560,6 +560,8 @@ xenapiDomainCreateXML(virConnectPtr conn,
|
|||||||
priv->caps, priv->xmlopt,
|
priv->caps, priv->xmlopt,
|
||||||
1 << VIR_DOMAIN_VIRT_XEN,
|
1 << VIR_DOMAIN_VIRT_XEN,
|
||||||
parse_flags);
|
parse_flags);
|
||||||
|
if (!defPtr)
|
||||||
|
return NULL;
|
||||||
createVMRecordFromXml(conn, defPtr, &record, &vm);
|
createVMRecordFromXml(conn, defPtr, &record, &vm);
|
||||||
virDomainDefFree(defPtr);
|
virDomainDefFree(defPtr);
|
||||||
if (record) {
|
if (record) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user