* src/esx/esx_driver.c: avoid potential virDomainPtr leaks
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 5a93d1f..91de407 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -1200,14 +1200,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; } @@ -1291,14 +1291,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; }
-- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list