From 1bd8601ce81500fc1ddf6584cd07379eec65083e Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 22 Sep 2004 00:28:11 +0000 Subject: [PATCH] memset freed blocks to 0xcd. --- src/threads/malloc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/threads/malloc.c b/src/threads/malloc.c index 9782a5a..9910bf4 100644 --- a/src/threads/malloc.c +++ b/src/threads/malloc.c @@ -177,8 +177,13 @@ free (void *p) a = block_to_arena (b); d = a->desc; +#ifndef NDEBUG + memset (b, 0xcd, d->block_size); +#endif + lock_acquire (&d->lock); + /* Add block to free list. */ list_push_front (&d->free_list, &b->free_elem); -- 2.30.2