From 97881a2fd4f248c6f69f5a905004be8e81fc2321 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 7 Dec 2021 16:34:00 +0100 Subject: [PATCH] virHostCPUGetInfoPopulateLinux: Use automatic memory freeing for virBitmap MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- 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.47.2