summaryrefslogtreecommitdiffstats
path: root/libsmartcols
diff options
context:
space:
mode:
authorKarel Zak2017-10-11 15:06:41 +0200
committerKarel Zak2017-10-11 15:06:41 +0200
commita30f2a9b7a2897077a14520986098ec9b0245234 (patch)
tree6aa0d1f75bced384a4df050cd15f02ae95f6aee7 /libsmartcols
parentlibmount: make sure we call stat() propely [coverity scan] (diff)
downloadkernel-qcow2-util-linux-a30f2a9b7a2897077a14520986098ec9b0245234.tar.gz
kernel-qcow2-util-linux-a30f2a9b7a2897077a14520986098ec9b0245234.tar.xz
kernel-qcow2-util-linux-a30f2a9b7a2897077a14520986098ec9b0245234.zip
libsmartcols: don't call free_buffer() for uninitialized variable [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libsmartcols')
-rw-r--r--libsmartcols/src/table_print.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libsmartcols/src/table_print.c b/libsmartcols/src/table_print.c
index 472c3616c..7a2c1a3dc 100644
--- a/libsmartcols/src/table_print.c
+++ b/libsmartcols/src/table_print.c
@@ -1409,6 +1409,7 @@ static int initialize_printing(struct libscols_table *tb, struct libscols_buffer
int rc;
DBG(TAB, ul_debugobj(tb, "initialize printing"));
+ *buf = NULL;
if (!tb->symbols) {
rc = scols_table_set_default_symbols(tb);
@@ -1516,7 +1517,7 @@ int scols_table_print_range( struct libscols_table *tb,
struct libscols_line *start,
struct libscols_line *end)
{
- struct libscols_buffer *buf;
+ struct libscols_buffer *buf = NULL;
struct libscols_iter itr;
int rc;
@@ -1602,7 +1603,7 @@ int scols_table_print_range_to_string(
static int __scols_print_table(struct libscols_table *tb, int *is_empty)
{
int rc = 0;
- struct libscols_buffer *buf;
+ struct libscols_buffer *buf = NULL;
if (!tb)
return -EINVAL;