From 00beda0ee23ffe43101c7dec69853ea74e84ed1e Mon Sep 17 00:00:00 2001 From: Matt Coleman Date: Thu, 21 Jan 2021 13:51:26 -0500 Subject: [PATCH] hyperv: use g_autoptr for Win32_PerfRawData_HvStats_HyperVHypervisorVirtualProcessor in hypervDomainGetVcpus Signed-off-by: Matt Coleman Reviewed-by: Laine Stump --- 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 4bf91cfa1a..84ffb24f1a 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -2071,7 +2071,7 @@ hypervDomainGetVcpus(virDomainPtr domain, int count = 0; int vcpu_number; hypervPrivate *priv = domain->conn->privateData; - Win32_PerfRawData_HvStats_HyperVHypervisorVirtualProcessor *vproc = NULL; + g_autoptr(Win32_PerfRawData_HvStats_HyperVHypervisorVirtualProcessor) vproc = NULL; /* Hyper-V does not allow setting CPU affinity: all cores will be used */ if (cpumaps && maplen > 0) @@ -2110,8 +2110,6 @@ hypervDomainGetVcpus(virDomainPtr domain, count++; } - hypervFreeObject((hypervObject *)vproc); - return count; }