From: Karel Zak Date: Fri, 17 Jul 2020 14:15:02 +0000 (+0200) Subject: lscpu: keep hypervisor name in allocated memory X-Git-Tag: v2.37-rc1~351 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=021d0b3d1dc5871eaa265f13e06e8b8ee2f0b088;p=thirdparty%2Futil-linux.git lscpu: keep hypervisor name in allocated memory Signed-off-by: Karel Zak --- diff --git a/sys-utils/lscpu-virt.c b/sys-utils/lscpu-virt.c index 56dc5c2ef0..3ffcbccb29 100644 --- a/sys-utils/lscpu-virt.c +++ b/sys-utils/lscpu-virt.c @@ -640,6 +640,8 @@ struct lscpu_virt *lscpu_read_virtualization(struct lscpu_cxt *cxt) memmove(str, str + 1, strlen(str)); break; } + if (virt->hypervisor) + virt->hypervisor = xstrdup(virt->hypervisor); fclose(fd); }