]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: keep hypervisor name in allocated memory
authorKarel Zak <kzak@redhat.com>
Fri, 17 Jul 2020 14:15:02 +0000 (16:15 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 13 Nov 2020 08:19:02 +0000 (09:19 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lscpu-virt.c

index 56dc5c2ef0689a552fc4453ad676b4e38552630f..3ffcbccb295e21ab2f8411974bd13744fe379e0c 100644 (file)
@@ -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);
        }