diff options
author | Sami Kerola | 2011-05-01 19:20:25 +0200 |
---|---|---|
committer | Sami Kerola | 2011-05-19 21:09:24 +0200 |
commit | dcbca568f72db12701519d0b060242610c12334e (patch) | |
tree | 78e51d848efb2b62747c60ec1a3178f0ac519c14 /text-utils/column.c | |
parent | column.c: make table function clarification (diff) | |
download | kernel-qcow2-util-linux-dcbca568f72db12701519d0b060242610c12334e.tar.gz kernel-qcow2-util-linux-dcbca568f72db12701519d0b060242610c12334e.tar.xz kernel-qcow2-util-linux-dcbca568f72db12701519d0b060242610c12334e.zip |
column.c: free memory before exit
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'text-utils/column.c')
-rw-r--r-- | text-utils/column.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/text-utils/column.c b/text-utils/column.c index 984b0ef5b..6b797d340 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -190,6 +190,11 @@ int main(int argc, char **argv) c_columnate(); else r_columnate(); + + for (int i = 0; i < entries; i++) + free(list[i]); + free(list); + if (ferror(stdout) || fclose(stdout)) eval = EXIT_FAILURE; exit(eval); @@ -314,6 +319,14 @@ static void maketbl() putwchar('\n'); } } + + for (cnt = 0; cnt < entries; ++cnt) { + free((tbl+cnt)->list); + free((tbl+cnt)->len); + } + free(cols); + free(lens); + free(tbl); } static void input(FILE *fp) |