From: Garrett Wollman Date: Sun, 15 Jul 2012 18:54:47 +0000 (-0400) Subject: util: in util_newTable, don't leak Table on error X-Git-Tag: upstream/1.8.0_pre1^2~2222 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=0527cc793054e582ea8be8c0dc76df9e2ca0ab1b;p=packages%2Fo%2Fopenafs.git util: in util_newTable, don't leak Table on error It is unlikely that this memory leak actually matters as the caller will normally just exit. This whole source file could stand to be reformatted. Change-Id: Ic5cb52a73ac09ae492c6e6ab606dfaf92a1ab8bf Reviewed-on: http://gerrit.openafs.org/7767 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/util/tabular_output.c b/src/util/tabular_output.c index 5866fbef1..cfd43b26e 100644 --- a/src/util/tabular_output.c +++ b/src/util/tabular_output.c @@ -369,6 +369,7 @@ util_newTable(int Type, int numColumns, char **ColumnHeaders, int *ColumnContent if (sortByColumn < 0 || sortByColumn > numColumns) { fprintf(stderr,"Invalid Table Sortkey: %d.\n", sortByColumn); errno=EINVAL; + free(Table); return NULL; } if (sortByColumn > 0 )