Coverity notes in xenapiDomainGetXMLDesc that 'vms' is dereferenced
a few times before a "if (vms) xen_vm_set_free(vms);" call is made.
Since we'd exit out much sooner if the fetch of the vms failed, just
remove the unnecessary "if (vms)" check.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/xenapi/xenapi_driver.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index 148ff9b..8eb8d73 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -1563,8 +1563,7 @@ xenapiDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
}
xen_vif_set_free(vif_set);
}
- if (vms)
- xen_vm_set_free(vms);
+ xen_vm_set_free(vms);
xml = virDomainDefFormat(defPtr, flags);
virDomainDefFree(defPtr);
return xml;
--
2.1.0