mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
domain_conf: Resolve Coverity REVERSE_INULL
Coverity complains that checking for domain->def being non NULL in the if (live) path of virDomainObjAssignDef() would be unnecessary or a NULL deref since the call to virDomainObjIsActive() would already dereference domain->def when checking if the def->id field was != -1. Checked all callers to virDomainObjAssignDef() and each at some point dereferences (vm)->def->{field} prior to calling when live is true.
This commit is contained in:
parent
39b9c12148
commit
0c5ca98597
@ -2247,13 +2247,11 @@ void virDomainObjAssignDef(virDomainObjPtr domain,
|
|||||||
domain->newDef = def;
|
domain->newDef = def;
|
||||||
} else {
|
} else {
|
||||||
if (live) {
|
if (live) {
|
||||||
if (domain->def) {
|
/* save current configuration to be restored on domain shutdown */
|
||||||
/* save current configuration to be restored on domain shutdown */
|
if (!domain->newDef)
|
||||||
if (!domain->newDef)
|
domain->newDef = domain->def;
|
||||||
domain->newDef = domain->def;
|
else
|
||||||
else
|
virDomainDefFree(domain->def);
|
||||||
virDomainDefFree(domain->def);
|
|
||||||
}
|
|
||||||
domain->def = def;
|
domain->def = def;
|
||||||
} else {
|
} else {
|
||||||
if (oldDef)
|
if (oldDef)
|
||||||
|
Loading…
Reference in New Issue
Block a user