projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d046ec9
)
fix mallocng regression in malloc_usable_size with null argument
author
Dominic Chen
<d.c.ddcc@gmail.com>
Wed, 25 Nov 2020 07:53:16 +0000
(
02:53
-0500)
committer
Rich Felker
<dalias@aerifal.cx>
Sun, 29 Nov 2020 06:07:05 +0000
(
01:07
-0500)
commit
d1507646975cbf6c3e511ba07b193f27f032d108
added support for null
argument in oldmalloc and was overlooked when switching to mallocng.
src/malloc/mallocng/malloc_usable_size.c
patch
|
blob
|
history
diff --git
a/src/malloc/mallocng/malloc_usable_size.c
b/src/malloc/mallocng/malloc_usable_size.c
index
a440a4e
..
ce6a960
100644
(file)
--- 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);