fix canary space reservation for pvalloc

This commit is contained in:
Daniel Micay 2018-10-14 17:43:03 -04:00
parent f11c448a0d
commit 4fbfe4d3ec

View File

@ -1084,14 +1084,14 @@ EXPORT void *h_valloc(size_t size) {
} }
EXPORT void *h_pvalloc(size_t size) { EXPORT void *h_pvalloc(size_t size) {
size_t rounded = PAGE_CEILING(size); size = PAGE_CEILING(size);
if (!rounded) { if (!size) {
errno = ENOMEM; errno = ENOMEM;
return NULL; return NULL;
} }
init(); init();
size = adjust_size_for_canaries(size); size = adjust_size_for_canaries(size);
return alloc_aligned_simple(PAGE_SIZE, rounded); return alloc_aligned_simple(PAGE_SIZE, size);
} }
EXPORT void h_free(void *p) { EXPORT void h_free(void *p) {