]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
hyperv: use g_autoptr for Win32_PerfRawData_HvStats_HyperVHypervisorVirtualProcessor...
authorMatt Coleman <mcoleman@datto.com>
Thu, 21 Jan 2021 18:51:26 +0000 (13:51 -0500)
committerLaine Stump <laine@redhat.com>
Fri, 22 Jan 2021 19:04:28 +0000 (14:04 -0500)
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
src/hyperv/hyperv_driver.c

index 4bf91cfa1a656b53971dc3ac1069b380faf3610f..84ffb24f1a363bb3d41ed4efc6962302dd5fa4a6 100644 (file)
@@ -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;
 }