]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: don't care about xasprintf() return code
authorKarel Zak <kzak@redhat.com>
Wed, 12 Dec 2012 11:13:38 +0000 (12:13 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 12 Dec 2012 11:13:38 +0000 (12:13 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lscpu.c

index 5ff5aa79de635021973f0dae1f10f4f4ec5189aa..7cdc9f927661cbe374cf9796e810da2c0d97512a 100644 (file)
@@ -565,8 +565,8 @@ read_hypervisor(struct lscpu_desc *desc)
                        str = strchr(buf, ':');
                        if (!str)
                                continue;
-                       if (xasprintf(&str, "%s", str + 1) == -1)
-                               errx(EXIT_FAILURE, _("failed to allocate memory"));
+                       xasprintf(&str, "%s", str + 1);
+
                        /* remove leading, trailing and repeating whitespace */
                        while (*str == ' ')
                                str++;