diff options
author | Sami Kerola | 2013-07-07 21:54:30 +0200 |
---|---|---|
committer | Karel Zak | 2013-07-09 14:25:05 +0200 |
commit | b6e69ba6fc71b0383b253149f0dd37489c6cbda8 (patch) | |
tree | 8d99738bb64cfec90978b501259c6ba96f905878 /sys-utils/lscpu-dmi.c | |
parent | ipcs: assigned values are never read [clang-analyzer] (diff) | |
download | kernel-qcow2-util-linux-b6e69ba6fc71b0383b253149f0dd37489c6cbda8.tar.gz kernel-qcow2-util-linux-b6e69ba6fc71b0383b253149f0dd37489c6cbda8.tar.xz kernel-qcow2-util-linux-b6e69ba6fc71b0383b253149f0dd37489c6cbda8.zip |
lscpu: fix memory leak [clang-analyzer]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/lscpu-dmi.c')
-rw-r--r-- | sys-utils/lscpu-dmi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys-utils/lscpu-dmi.c b/sys-utils/lscpu-dmi.c index 21e024bc4..8f02779d6 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; |