]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: check scols_line_set_data() return value [coverity scan]
authorKarel Zak <kzak@redhat.com>
Tue, 28 May 2019 10:05:03 +0000 (12:05 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 28 May 2019 10:05:03 +0000 (12:05 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lscpu.c

index 48b3764585b74f0fa4c0e0698e8c5dcffc83e688..0e775805e6e24dcc027fd104f37313e6953b4098 100644 (file)
@@ -1881,7 +1881,8 @@ static void __attribute__ ((__format__(printf, 3, 4)))
                err(EXIT_FAILURE, _("failed to allocate output line"));
 
        /* description column */
-       scols_line_set_data(ln, 0, txt);
+       if (txt && scols_line_set_data(ln, 0, txt))
+               err(EXIT_FAILURE, _("failed to add output data"));
 
        /* data column */
        va_start(args, fmt);