mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00: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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
domain = virGetDomain(conn, name_candidate, uuid_candidate);
|
if (esxVI_GetVirtualMachinePowerState(conn, virtualMachine,
|
||||||
|
&powerState) < 0) {
|
||||||
if (domain == NULL) {
|
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (esxVI_GetVirtualMachinePowerState(conn, virtualMachine,
|
domain = virGetDomain(conn, name_candidate, uuid_candidate);
|
||||||
&powerState) < 0) {
|
|
||||||
|
if (domain == NULL) {
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1138,14 +1138,14 @@ esxDomainLookupByName(virConnectPtr conn, const char *name)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
domain = virGetDomain(conn, name_candidate, uuid_candidate);
|
if (esxVI_GetVirtualMachinePowerState(conn, virtualMachine,
|
||||||
|
&powerState) < 0) {
|
||||||
if (domain == NULL) {
|
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (esxVI_GetVirtualMachinePowerState(conn, virtualMachine,
|
domain = virGetDomain(conn, name_candidate, uuid_candidate);
|
||||||
&powerState) < 0) {
|
|
||||||
|
if (domain == NULL) {
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user