diff options
author | Pádraig Brady <P@draigBrady.com> | 2010-11-25 19:16:00 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2010-11-27 03:27:49 +0000 |
commit | b8cd747cc8039237ec17482e984847df08b10291 (patch) | |
tree | 1c49d7f362b125e6476f5f2d0e959381a7e1b39b /src | |
parent | 67f7ed3e3ab963af468b2accf9d178f469d3b12d (diff) | |
download | coreutils-b8cd747cc8039237ec17482e984847df08b10291.tar.xz |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/tsort.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tsort.c b/src/tsort.c index 4f51f3074..0179a4e76 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--; |