refactoring: Use the return value of virObjectRef directly

Use the return value of virObjectRef directly. This way, it's easier
for another reader to identify the reason why the additional reference
is required.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
This commit is contained in:
Marc Hartmayer
2017-04-03 10:24:39 +02:00
committed by Michal Privoznik
parent 7a665f2451
commit fd6e3f48ed
4 changed files with 7 additions and 15 deletions

View File

@@ -1064,8 +1064,7 @@ qemuMonitorCommonTestNew(virDomainXMLOptionPtr xmlopt,
goto error;
if (vm) {
virObjectRef(vm);
test->vm = vm;
test->vm = virObjectRef(vm);
} else {
test->vm = virDomainObjNew(xmlopt);
if (!test->vm)