summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/malloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/malloc.c b/src/common/malloc.c
index 70d6f89af..7f1d60b29 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -398,7 +398,7 @@ void _mfree(void *ptr, const char *file, int line, const char *func )
head->block = NULL;
#ifdef DEBUG_MEMMGR
// set freed memory to 0xDD (dead memory)
- memset(ptr, 0xDD, block->unit_size - sizeof(struct unit_head) + sizeof(int) );
+ memset(ptr, 0xDD, head->size - sizeof(struct unit_head) + sizeof(int) );
#endif
memmgr_usage_bytes -= head->size;
if(--block->unit_used == 0) {