[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[coreutils] [PATCH] tsort: suppress a valgrind memory leak warning
From: |
Pádraig Brady |
Subject: |
[coreutils] [PATCH] tsort: suppress a valgrind memory leak warning |
Date: |
Fri, 26 Nov 2010 00:18:54 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 |
This is the only "definitely lost" warning left
from valgrind --tool=memcheck.
commit c8b88772b61ffb3d9f73fc6b9985ec7b35495f87
Author: Pádraig Brady <address@hidden>
Date: Thu Nov 25 19:16:00 2010 +0000
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
diff --git a/src/tsort.c b/src/tsort.c
index 4f51f30..b27cdfa 100644
--- a/src/tsort.c
+++ b/src/tsort.c
@@ -487,6 +487,10 @@ tsort (const char *file)
/* T5. Output front of queue. */
puts (head->str);
+#ifdef lint
+ /* suppress valgrind "definitely lost" warnings. */
+ free ((void *) head->str);
+#endif
head->str = NULL; /* Avoid printing the same string twice. */
n_strings--;
- [coreutils] [PATCH] tsort: suppress a valgrind memory leak warning,
Pádraig Brady <=