diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2011-09-08 01:06:12 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2011-09-08 01:06:12 +0000 |
commit | 60e510609886543e9aec44ec7909d1426129a47a (patch) | |
tree | f6ef5d505c2916f49a0653193cb2f31ba720ce4e | |
parent | 636bb94fe69e48f07e87cc206ad730aeecb58158 (diff) |
cleanup our own leak checker so that valgrind is happy with it.
-rw-r--r-- | DebugMemory.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/DebugMemory.c b/DebugMemory.c index ff5b6988..f9f38e70 100644 --- a/DebugMemory.c +++ b/DebugMemory.c @@ -209,7 +209,10 @@ void DebugMemory_report() { assert(walk->magic == 11061980); i++; fprintf(stderr, "%p %s:%d\n", walk->data, walk->file, walk->line); + DebugMemoryItem* old = walk; walk = walk->next; + free(old->file); + free(old); } fprintf(stderr, "Total:\n"); fprintf(stderr, "%d allocations\n", singleton->allocations); @@ -218,6 +221,7 @@ void DebugMemory_report() { fprintf(stderr, "%d non-freed blocks\n", i); if (singleton->file) fclose(singleton->file); + free(singleton); } #elif defined(DEBUGLITE) |