From 847a7c7c2e31b58f7fde196e11840044cbb64126 Mon Sep 17 00:00:00 2001 From: Matthias Bolte Date: Mon, 14 Sep 2009 12:44:33 +0200 Subject: [PATCH] ESX avoid potential leaks * src/esx/esx_driver.c: reorder some function calls to avoid potential virDomainPtr leaks --- src/esx/esx_driver.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 8d1af7150c..f91d48dc90 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -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; } -- 2.47.2