1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-02-04 21:47:16 +03:00

conf: Fix mistakes in pointer usage in virDomainObjGetDefs

Coverity rightfully determined that in commit 3d021381c71221e563182f03
I made a mistake in the first check if @persDef is not NULL is
dereferencing it rather than checking.

Additionally if the vm is online the code would set @liveDef twice
rather than modifying @persDef. Fix both mistakes.
This commit is contained in:
Peter Krempa 2015-06-04 13:20:12 +02:00
parent f833c70b85
commit f9ab9effc5

View File

@ -2927,7 +2927,7 @@ virDomainObjGetDefs(virDomainObjPtr vm,
if (liveDef)
*liveDef = NULL;
if (*persDef)
if (persDef)
*persDef = NULL;
if (virDomainObjUpdateModificationImpact(vm, &flags) < 0)
@ -2938,7 +2938,7 @@ virDomainObjGetDefs(virDomainObjPtr vm,
*liveDef = vm->def;
if (persDef)
*liveDef = vm->newDef;
*persDef = vm->newDef;
} else {
if (persDef)
*persDef = vm->def;