summaryrefslogtreecommitdiffstats
path: root/text-utils/column.c
diff options
context:
space:
mode:
Diffstat (limited to 'text-utils/column.c')
-rw-r--r--text-utils/column.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/text-utils/column.c b/text-utils/column.c
index 0f2e7e1..06aeaa0 100644
--- a/text-utils/column.c
+++ b/text-utils/column.c
@@ -585,7 +585,7 @@ static void add_entry(struct column_control *ctl, size_t *maxents, wchar_t *wcs)
{
if (ctl->nents <= *maxents) {
*maxents += 1000;
- ctl->ents = xrealloc(ctl->ents, *maxents * sizeof(wchar_t *));
+ ctl->ents = xreallocarray(ctl->ents, *maxents, sizeof(wchar_t *));
}
ctl->ents[ctl->nents] = wcs;
ctl->nents++;
@@ -662,6 +662,8 @@ static int read_input(struct column_control *ctl, FILE *fp)
}
} while (rc == 0);
+ free(buf);
+
return rc;
}
@@ -776,8 +778,8 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(USAGE_SEPARATOR, out);
- printf(USAGE_HELP_OPTIONS(34));
- printf(USAGE_MAN_TAIL("column(1)"));
+ fprintf(out, USAGE_HELP_OPTIONS(34));
+ fprintf(out, USAGE_MAN_TAIL("column(1)"));
exit(EXIT_SUCCESS);
}