diff options
Diffstat (limited to 'minecproxy/misc.c')
-rw-r--r-- | minecproxy/misc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/minecproxy/misc.c b/minecproxy/misc.c index e3872c5..0f0da00 100644 --- a/minecproxy/misc.c +++ b/minecproxy/misc.c @@ -102,9 +102,6 @@ void __xfree(const char *fn, int line, void *ptr) if (!ptr) return; - free(ptr); - malloc_count--; - debug(DBG_MALLOC, "called from %s:%i - %p", fn, line, ptr); list_for_each_entry_safe(a, tmp, &malloc_list, list) { @@ -119,6 +116,9 @@ void __xfree(const char *fn, int line, void *ptr) error("Delete count is %u for ptr 0x%p", delete_count, ptr); exit(EXIT_FAILURE); } + + free(ptr); + malloc_count--; } void debug_resource_usage() |