diff options
Diffstat (limited to 'userland/libc/malloc/malloc.c')
-rw-r--r-- | userland/libc/malloc/malloc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/userland/libc/malloc/malloc.c b/userland/libc/malloc/malloc.c index f351291..5c2fe98 100644 --- a/userland/libc/malloc/malloc.c +++ b/userland/libc/malloc/malloc.c @@ -220,9 +220,12 @@ void free(void *p) { // Is this a assumption that can be made? MallocHeader *h = (MallocHeader *)((uint32_t)p - sizeof(MallocHeader)); if (MALLOC_HEADER_MAGIC != h->magic) { +#ifdef LIBC_DEBUG + printf("LibC Malloc: free() is attempted at the incorrect location or at a corrupted header.\n"); printf("h->magic: %x\n", h->magic); printf("&h->magic: %x\n", &(h->magic)); - assert(0); +#endif + return; } if (h->flags & IS_FREE) return; |