From: Matt Coleman Date: Thu, 21 Jan 2021 18:51:26 +0000 (-0500) Subject: hyperv: use g_autoptr for Win32_PerfRawData_HvStats_HyperVHypervisorVirtualProcessor... X-Git-Tag: v7.1.0-rc1~455 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00beda0ee23ffe43101c7dec69853ea74e84ed1e;p=thirdparty%2Flibvirt.git hyperv: use g_autoptr for Win32_PerfRawData_HvStats_HyperVHypervisorVirtualProcessor in hypervDomainGetVcpus Signed-off-by: Matt Coleman Reviewed-by: Laine Stump --- 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; }