]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: avoid double free
authorSami Kerola <kerolasa@iki.fi>
Sun, 13 Jul 2014 17:30:32 +0000 (18:30 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sun, 13 Jul 2014 17:35:39 +0000 (18:35 +0100)
The double free was possible for architectures other than x86_64 or i386.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sys-utils/lscpu-dmi.c

index 251d4acc40bdc3f6ff296e78182e4ab1de1b224c..6c870a11348858dbf283615784dcc592f2be8d9a 100644 (file)
@@ -258,7 +258,7 @@ int read_hypervisor_dmi(void)
        if (rc)
                goto done;
        free(buf);
-
+       buf = NULL;
 memory_scan:
 #if defined(__x86_64__) || defined(__i386__)
        /* Fallback to memory scan (x86, x86_64) */