From b8cd747cc8039237ec17482e984847df08b10291 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Thu, 25 Nov 2010 19:16:00 +0000 Subject: [PATCH] tsort: suppress a valgrind memory leak warning * src/tsort.c (tsort): Unconditionally invoking the free() doesn't increase scalability, so do it only with -Dlint --- src/tsort.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tsort.c b/src/tsort.c index 4f51f30..0179a4e 100644 --- a/src/tsort.c +++ b/src/tsort.c @@ -487,6 +487,11 @@ tsort (const char *file) /* T5. Output front of queue. */ puts (head->str); +#ifdef lint + /* suppress valgrind "definitely lost" warnings. */ + void *head_str = (void *) head->str; + free (head_str); +#endif head->str = NULL; /* Avoid printing the same string twice. */ n_strings--; -- 2.7.4