summaryrefslogtreecommitdiff
path: root/Zend/zend_alloc.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-12-02 16:29:13 +0300
committerDmitry Stogov <dmitry@zend.com>2014-12-02 16:29:13 +0300
commit9e27a69c2fb52a3c52a3c60181e21ecb0eeb54d5 (patch)
tree486dd5d960e966e2ce3b1c3e96dc164d9eda0e0e /Zend/zend_alloc.c
parent1982bce1a8d8e0d160156bcb01ce017c3f092ae6 (diff)
downloadphp-git-9e27a69c2fb52a3c52a3c60181e21ecb0eeb54d5.tar.gz
Fixed improper memory release
Diffstat (limited to 'Zend/zend_alloc.c')
-rw-r--r--Zend/zend_alloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index 8689ee8829..a1af2fcc7f 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -764,7 +764,9 @@ static void *zend_mm_chunk_alloc_int(size_t size, size_t alignment)
offset = alignment - offset;
zend_mm_munmap(ptr, offset);
ptr = (char*)ptr + offset;
- } else {
+ alignment -= offset;
+ }
+ if (alignment > REAL_PAGE_SIZE) {
zend_mm_munmap((char*)ptr + size, alignment - REAL_PAGE_SIZE);
}
# ifdef MADV_HUGEPAGE