[PATCH 14/14] lscpu: avoid double free

Sami Kerola
2014-07-13T20:25:44Z

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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys-utils/lscpu-dmi.c b/sys-utils/lscpu-dmi.c
index 251d4ac..6c870a1 100644
--- a/sys-utils/lscpu-dmi.c
+++ b/sys-utils/lscpu-dmi.c
@@ -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) */
--
2.0.1