summaryrefslogtreecommitdiff
path: root/Zend/zend_alloc.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2007-03-12 16:59:52 +0000
committerDmitry Stogov <dmitry@php.net>2007-03-12 16:59:52 +0000
commitab699d03bc841f14718b4563bd50288168473640 (patch)
treebac08119a3781d7735b1c8904d66b3e6f9f465d1 /Zend/zend_alloc.c
parented844bbb3f62846e50da6939554deb7d325bcb33 (diff)
downloadphp-git-ab699d03bc841f14718b4563bd50288168473640.tar.gz
Fixed bug #40770 (Apache child exits when PHP memory limit reached)
Diffstat (limited to 'Zend/zend_alloc.c')
-rw-r--r--Zend/zend_alloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index 736b6303e2..34f5b77b60 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -1714,6 +1714,9 @@ realloc_segment:
segment_copy = (zend_mm_segment *) ((char *)mm_block - ZEND_MM_ALIGNED_SEGMENT_SIZE);
if (segment_size < true_size ||
heap->real_size + segment_size - segment_copy->size > heap->limit) {
+ if (ZEND_MM_IS_FREE_BLOCK(next_block)) {
+ zend_mm_add_to_free_list(heap, (zend_mm_free_block *) next_block);
+ }
#if ZEND_MM_CACHE
zend_mm_free_cache(heap);
#endif