From 5d464f524ba5447e2a8fc77560b98c1ad9a83570 Mon Sep 17 00:00:00 2001 From: Dominic Chen Date: Wed, 25 Nov 2020 02:53:16 -0500 Subject: fix mallocng regression in malloc_usable_size with null argument commit d1507646975cbf6c3e511ba07b193f27f032d108 added support for null argument in oldmalloc and was overlooked when switching to mallocng. --- src/malloc/mallocng/malloc_usable_size.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/malloc/mallocng/malloc_usable_size.c b/src/malloc/mallocng/malloc_usable_size.c index a440a4ea..ce6a960c 100644 --- a/src/malloc/mallocng/malloc_usable_size.c +++ b/src/malloc/mallocng/malloc_usable_size.c @@ -3,6 +3,7 @@ size_t malloc_usable_size(void *p) { + if (!p) return 0; struct meta *g = get_meta(p); int idx = get_slot_index(p); size_t stride = get_stride(g); -- cgit v1.2.1