[PATCH 14/14] lscpu: avoid double free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The double free was possible for architectures other than x86_64 or i386.

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux