From: Karel Zak Date: Mon, 10 Jun 2013 09:08:08 +0000 (+0200) Subject: wdctl: use TT_FL_FREEDATA for tt table X-Git-Tag: v2.24-rc1~208 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ffddb6a0ba80feb4ced540567ab65f47933d388;p=thirdparty%2Futil-linux.git wdctl: use TT_FL_FREEDATA for tt table Signed-off-by: Karel Zak --- diff --git a/sys-utils/wdctl.c b/sys-utils/wdctl.c index af9a393387..2698853e9e 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;