]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
tabular_output: don't leak table struct on error exit
authorGarrett Wollman <wollman@csail.mit.edu>
Wed, 25 Jul 2012 04:41:05 +0000 (00:41 -0400)
committerDerrick Brashear <shadow@dementix.org>
Thu, 26 Jul 2012 18:49:56 +0000 (11:49 -0700)
The caller is almost certainly going to exit when we return, but
all the same, don't leak the table description structure in the
error exit.  Makes the static analyzer happier.

Change-Id: I55e986a3601968751921ee38badf5bb86cd3174f
Reviewed-on: http://gerrit.openafs.org/7870
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/util/tabular_output.c

index cfd43b26ed1c227ce0e024f6b21ee95e53ba5a2f..7f8eb291ab90e2a801e308442083cfd20236cbb0 100644 (file)
@@ -399,6 +399,7 @@ util_newTable(int Type, int numColumns, char **ColumnHeaders, int *ColumnContent
                 break;
         default :
                 fprintf(stderr,"Error. Invalid TableType: %d.\n", Table->Type);
+               free(Table);
                errno=EINVAL;
                 return NULL;
     }