diff options
Diffstat (limited to 'src/malloc')
-rw-r--r-- | src/malloc/malloc_usable_size.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/malloc/malloc_usable_size.c b/src/malloc/malloc_usable_size.c index 8cccd9d8..6743ea77 100644 --- a/src/malloc/malloc_usable_size.c +++ b/src/malloc/malloc_usable_size.c @@ -13,5 +13,5 @@ struct chunk { size_t malloc_usable_size(void *p) { - return CHUNK_SIZE(MEM_TO_CHUNK(p)) - OVERHEAD; + return p ? CHUNK_SIZE(MEM_TO_CHUNK(p)) - OVERHEAD : 0; } |