[PATCH 36/36] virHostCPUGetInfoPopulateLinux: Use automatic memory freeing for virBitmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/util/virhostcpu.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index 83e3a5d0f1..54e2462a95 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -582,8 +582,8 @@ virHostCPUGetInfoPopulateLinux(FILE *cpuinfo,
                                unsigned int *cores,
                                unsigned int *threads)
 {
-    virBitmap *present_cpus_map = NULL;
-    virBitmap *online_cpus_map = NULL;
+    g_autoptr(virBitmap) present_cpus_map = NULL;
+    g_autoptr(virBitmap) online_cpus_map = NULL;
     g_autoptr(DIR) nodedir = NULL;
     struct dirent *nodedirent = NULL;
     int nodecpus, nodecores, nodesockets, nodethreads, offline = 0;
@@ -745,8 +745,6 @@ virHostCPUGetInfoPopulateLinux(FILE *cpuinfo,
     ret = 0;

  cleanup:
-    virBitmapFree(present_cpus_map);
-    virBitmapFree(online_cpus_map);
     VIR_FREE(sysfs_nodedir);
     VIR_FREE(sysfs_cpudir);
     return ret;
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux