From: Peter Krempa Date: Tue, 7 Dec 2021 15:34:00 +0000 (+0100) Subject: virHostCPUGetInfoPopulateLinux: Use automatic memory freeing for virBitmap X-Git-Tag: v8.0.0-rc1~293 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97881a2fd4f248c6f69f5a905004be8e81fc2321;p=thirdparty%2Flibvirt.git virHostCPUGetInfoPopulateLinux: Use automatic memory freeing for virBitmap Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- 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;