mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-13 00:46:03 -06:00
ESX avoid potential leaks
* src/esx/esx_driver.c: reorder some function calls to avoid potential virDomainPtr leaks
This commit is contained in:
parent
f98be4d35c
commit
847a7c7c2e
@ -1047,14 +1047,14 @@ esxDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
|
||||
continue;
|
||||
}
|
||||
|
||||
domain = virGetDomain(conn, name_candidate, uuid_candidate);
|
||||
|
||||
if (domain == NULL) {
|
||||
if (esxVI_GetVirtualMachinePowerState(conn, virtualMachine,
|
||||
&powerState) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
if (esxVI_GetVirtualMachinePowerState(conn, virtualMachine,
|
||||
&powerState) < 0) {
|
||||
domain = virGetDomain(conn, name_candidate, uuid_candidate);
|
||||
|
||||
if (domain == NULL) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@ -1138,14 +1138,14 @@ esxDomainLookupByName(virConnectPtr conn, const char *name)
|
||||
continue;
|
||||
}
|
||||
|
||||
domain = virGetDomain(conn, name_candidate, uuid_candidate);
|
||||
|
||||
if (domain == NULL) {
|
||||
if (esxVI_GetVirtualMachinePowerState(conn, virtualMachine,
|
||||
&powerState) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
if (esxVI_GetVirtualMachinePowerState(conn, virtualMachine,
|
||||
&powerState) < 0) {
|
||||
domain = virGetDomain(conn, name_candidate, uuid_candidate);
|
||||
|
||||
if (domain == NULL) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user