From: Christof Hanke Date: Wed, 18 Nov 2015 13:02:50 +0000 (+0100) Subject: tabular_output: allocate footer-line when set for the first time X-Git-Tag: upstream/1.8.0_pre1^2~203 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=5a0e69726d4a8cedb29e074d398f0ff29984524e;p=packages%2Fo%2Fopenafs.git tabular_output: allocate footer-line when set for the first time If the footer line is not allocated, programs segfault at runtime. The printFooter functions should check if the footer is allocated before printing them. Change-Id: Ib4066a67ee104be918811e178c0b7d7d33d790b8 Reviewed-on: http://gerrit.openafs.org/11753 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- diff --git a/src/util/tabular_output.c b/src/util/tabular_output.c index 6c053ccac..7c883a81b 100644 --- a/src/util/tabular_output.c +++ b/src/util/tabular_output.c @@ -90,6 +90,8 @@ util_setTableBodyRow(struct util_Table *Table, int RowIndex, char **Contents) { } int util_setTableFooter(struct util_Table * Table, char ** Contents) { + if (Table->Footer != NULL) + Table->Footer = newTableRow(Table); return do_setTableRow(Table,Table->Footer,Contents); }