about summary refs log tree commit diff
path: root/malloc/malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'malloc/malloc.c')
-rw-r--r--malloc/malloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 311fd174a4..37249b0c7a 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -2026,7 +2026,7 @@ new_heap(size) size_t size;
      anyway). */
   p1 = (char *)MMAP(0, HEAP_MAX_SIZE<<1, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE);
   if(p1 != MAP_FAILED) {
-    p2 = (char *)(((unsigned long)p1 + HEAP_MAX_SIZE) & ~(HEAP_MAX_SIZE-1));
+    p2 = (char *)(((unsigned long)p1 + (HEAP_MAX_SIZE-1)) & ~(HEAP_MAX_SIZE-1));
     ul = p2 - p1;
     munmap(p1, ul);
     munmap(p2 + HEAP_MAX_SIZE, HEAP_MAX_SIZE - ul);