From: Sami Kerola Date: Sun, 7 Jul 2013 19:54:30 +0000 (+0100) Subject: lscpu: fix memory leak [clang-analyzer] X-Git-Tag: v2.24-rc1~441 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b6e69ba6fc71b0383b253149f0dd37489c6cbda8;p=thirdparty%2Futil-linux.git lscpu: fix memory leak [clang-analyzer] Signed-off-by: Sami Kerola --- diff --git a/sys-utils/lscpu-dmi.c b/sys-utils/lscpu-dmi.c index 21e024bc41..8f02779d6e 100644 --- a/sys-utils/lscpu-dmi.c +++ b/sys-utils/lscpu-dmi.c @@ -130,8 +130,10 @@ static int hypervisor_from_dmi_table(uint32_t base, uint16_t len, * is invalid, but we cannot reliably locate the next entry. * Better stop at this point. */ - if (h.length < 4) + if (h.length < 4) { + free(data); return HYPER_NONE; + } /* look for the next handle */ next = data + h.length;