[PATCH 41/55] hyperv: use g_autoptr for Msvm_ComputerSystem in hypervConnectListAllDomains

Matt Coleman mcoleman at datto.com
Thu Jan 21 18:51:21 UTC 2021


Signed-off-by: Matt Coleman <matt at datto.com>
---
 src/hyperv/hyperv_driver.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index f134b7f137..2dfccb4802 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -2869,7 +2869,7 @@ hypervConnectListAllDomains(virConnectPtr conn,
 {
     hypervPrivate *priv = conn->privateData;
     g_auto(virBuffer) query = VIR_BUFFER_INITIALIZER;
-    Msvm_ComputerSystem *computerSystemList = NULL;
+    g_autoptr(Msvm_ComputerSystem) computerSystemList = NULL;
     Msvm_ComputerSystem *computerSystem = NULL;
     size_t ndoms;
     virDomainPtr domain;
@@ -2981,8 +2981,6 @@ hypervConnectListAllDomains(virConnectPtr conn,
         VIR_FREE(doms);
     }
 
-    hypervFreeObject((hypervObject *)computerSystemList);
-
     return ret;
 }
 #undef MATCH
-- 
2.30.0





More information about the libvir-list mailing list