Skip to content

Commit 600402d

Browse files
bigboysundstogov
authored andcommitted
Update zend_alloc.c
Don't free main thunk. It will crash.
1 parent 340a067 commit 600402d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Zend/zend_alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ static zend_always_inline void zend_mm_free_pages_ex(zend_mm_heap *heap, zend_mm
10991099
/* this setting may be not accurate */
11001100
chunk->free_tail = page_num;
11011101
}
1102-
if (free_chunk && chunk->free_pages == ZEND_MM_PAGES - ZEND_MM_FIRST_PAGE) {
1102+
if (free_chunk && chunk != heap->main_chunk && chunk->free_pages == ZEND_MM_PAGES - ZEND_MM_FIRST_PAGE) {
11031103
zend_mm_delete_chunk(heap, chunk);
11041104
}
11051105
}

0 commit comments

Comments
 (0)