Signed-off-by: Matt Coleman <matt(a)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 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;
}
--
2.30.0