summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys-utils/lscpu-dmi.c4
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;