mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
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
This commit is contained in:
1 parent
67f7ed3e3a
commit
b8cd747cc8
1 file changed
+5
@@ -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--;
|
||||
|
||||
|
||||
Reference in new issue
Block a user