fix canary space reservation for pvalloc

pull/65/head
Daniel Micay 2018-10-14 17:43:03 -04:00
parent f11c448a0d
commit 4fbfe4d3ec
1 changed files with 3 additions and 3 deletions

View File

@ -1084,14 +1084,14 @@ EXPORT void *h_valloc(size_t size) {
}
EXPORT void *h_pvalloc(size_t size) {
size_t rounded = PAGE_CEILING(size);
if (!rounded) {
size = PAGE_CEILING(size);
if (!size) {
errno = ENOMEM;
return NULL;
}
init();
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) {