From 2ffddb6a0ba80feb4ced540567ab65f47933d388 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 10 Jun 2013 11:08:08 +0200 Subject: wdctl: use TT_FL_FREEDATA for tt table Signed-off-by: Karel Zak --- sys-utils/wdctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys-utils/wdctl.c') diff --git a/sys-utils/wdctl.c b/sys-utils/wdctl.c index af9a39338..2698853e9 100644 --- a/sys-utils/wdctl.c +++ b/sys-utils/wdctl.c @@ -28,6 +28,7 @@ #include "nls.h" #include "c.h" +#include "xalloc.h" #include "closestream.h" #include "optutils.h" #include "pathnames.h" @@ -232,7 +233,7 @@ static void add_flag_line(struct tt *tt, struct wdinfo *wd, const struct wdflag } if (str) - tt_line_set_data(line, i, str); + tt_line_set_data(line, i, xstrdup(str)); } } @@ -244,7 +245,7 @@ static int show_flags(struct wdinfo *wd, int tt_flags, uint32_t wanted) uint32_t flags; /* create output table */ - tt = tt_new_table(tt_flags); + tt = tt_new_table(tt_flags | TT_FL_FREEDATA); if (!tt) { warn(_("failed to initialize output table")); return -1; -- cgit v1.2.3-55-g7522