]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: fix mem-leak in cpu
authorKarel Zak <kzak@redhat.com>
Wed, 13 May 2020 11:33:13 +0000 (13:33 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 13 Nov 2020 08:19:02 +0000 (09:19 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lscpu-cpu.c

index b8de1bbe4676ff175525f7078bcdb90f30045400..81e3f691c69ba8ed2393d5014bec369e6f7bafbf 100644 (file)
@@ -26,6 +26,9 @@ void lscpu_unref_cpu(struct lscpu_cpu *cpu)
        if (--cpu->refcount <= 0) {
                DBG(CPU, ul_debugobj(cpu, "  freeing"));
                lscpu_unref_cputype(cpu->type);
+               free(cpu->dynamic_mhz);
+               free(cpu->static_mhz);
+               free(cpu->mhz);
                free(cpu);
        }
 }