提交 f9ab9eff 编写于 作者: P Peter Krempa

conf: Fix mistakes in pointer usage in virDomainObjGetDefs

Coverity rightfully determined that in commit 3d021381
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.
上级 f833c70b
...@@ -2927,7 +2927,7 @@ virDomainObjGetDefs(virDomainObjPtr vm, ...@@ -2927,7 +2927,7 @@ virDomainObjGetDefs(virDomainObjPtr vm,
if (liveDef) if (liveDef)
*liveDef = NULL; *liveDef = NULL;
if (*persDef) if (persDef)
*persDef = NULL; *persDef = NULL;
if (virDomainObjUpdateModificationImpact(vm, &flags) < 0) if (virDomainObjUpdateModificationImpact(vm, &flags) < 0)
...@@ -2938,7 +2938,7 @@ virDomainObjGetDefs(virDomainObjPtr vm, ...@@ -2938,7 +2938,7 @@ virDomainObjGetDefs(virDomainObjPtr vm,
*liveDef = vm->def; *liveDef = vm->def;
if (persDef) if (persDef)
*liveDef = vm->newDef; *persDef = vm->newDef;
} else { } else {
if (persDef) if (persDef)
*persDef = vm->def; *persDef = vm->def;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册