mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-23 06:23:10 +00:00
xen: Resolve Coverity FORWARD_NULL issue
Commit '18b14012' refactored the Xen code resulting in a Coverity warning about possible NULL reference if the path where the XM driver takes puts the def on it's list. Moved/duplicated the virGetDomain() call to pacify the possible NULL deref.
This commit is contained in:
parent
e4de214b38
commit
677981d1be
@ -1656,13 +1656,14 @@ xenUnifiedDomainDefineXML(virConnectPtr conn, const char *xml)
|
||||
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
|
||||
if (xenXMDomainDefineXML(conn, def) < 0)
|
||||
goto cleanup;
|
||||
ret = virGetDomain(conn, def->name, def->uuid);
|
||||
def = NULL; /* XM driver owns it now */
|
||||
} else {
|
||||
if (xenDaemonDomainDefineXML(conn, def) < 0)
|
||||
goto cleanup;
|
||||
ret = virGetDomain(conn, def->name, def->uuid);
|
||||
}
|
||||
|
||||
ret = virGetDomain(conn, def->name, def->uuid);
|
||||
if (ret)
|
||||
ret->id = -1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user