Commit 60e51060 authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

cleanup our own leak checker so that valgrind is happy with it.

parent 636bb94f
...@@ -209,7 +209,10 @@ void DebugMemory_report() { ...@@ -209,7 +209,10 @@ void DebugMemory_report() {
assert(walk->magic == 11061980); assert(walk->magic == 11061980);
i++; i++;
fprintf(stderr, "%p %s:%d\n", walk->data, walk->file, walk->line); fprintf(stderr, "%p %s:%d\n", walk->data, walk->file, walk->line);
DebugMemoryItem* old = walk;
walk = walk->next; walk = walk->next;
free(old->file);
free(old);
} }
fprintf(stderr, "Total:\n"); fprintf(stderr, "Total:\n");
fprintf(stderr, "%d allocations\n", singleton->allocations); fprintf(stderr, "%d allocations\n", singleton->allocations);
...@@ -218,6 +221,7 @@ void DebugMemory_report() { ...@@ -218,6 +221,7 @@ void DebugMemory_report() {
fprintf(stderr, "%d non-freed blocks\n", i); fprintf(stderr, "%d non-freed blocks\n", i);
if (singleton->file) if (singleton->file)
fclose(singleton->file); fclose(singleton->file);
free(singleton);
} }
#elif defined(DEBUGLITE) #elif defined(DEBUGLITE)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment