From a4b640549df3216282f9d9924901b1521c3e2d69 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Fri, 4 Sep 2015 14:38:06 +0100 Subject: maint: avoid "definitely lost" valgrind warnings Since commit v8.23-19-g8defcee, main() will return, rather than call exit(), this inducing "definitely lost" warnings in valgrind's leak checker. That precludes using the following to flag memory leaks: valgrind --leak-check=full --error-exitcode=1 \ --errors-for-leak-kinds=definite * src/pr.c (main): In dev builds, explicitly free memory allocated. * src/sort.c (main): Likewise. * src/tail.c (main): Likewise. * src/tsort.c (tsort): Likewise. --- src/tail.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/tail.c') diff --git a/src/tail.c b/src/tail.c index c062d403f..f916d7460 100644 --- a/src/tail.c +++ b/src/tail.c @@ -2354,6 +2354,8 @@ main (int argc, char **argv) tail_forever (F, n_files, sleep_interval); } + IF_LINT (free (F)); + if (have_read_stdin && close (STDIN_FILENO) < 0) error (EXIT_FAILURE, errno, "-"); return ok ? EXIT_SUCCESS : EXIT_FAILURE; -- cgit v1.2.3-54-g00ecf