mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-12-18 12:24:27 -05:00
optimize calloc when zero on free is disabled
This commit is contained in:
parent
8f921e30be
commit
9a1acce5eb
2
malloc.c
2
malloc.c
@ -785,7 +785,7 @@ EXPORT void *h_calloc(size_t nmemb, size_t size) {
|
|||||||
if (unlikely(p == NULL)) {
|
if (unlikely(p == NULL)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (size) {
|
if (size && size <= max_slab_size_class) {
|
||||||
memset(p, 0, total_size - canary_size);
|
memset(p, 0, total_size - canary_size);
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
|
Loading…
Reference in New Issue
Block a user