Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Zend/zend_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,12 @@ static zend_always_inline void zend_mm_free_small(zend_mm_heap *heap, void *ptr,
#endif

p = (zend_mm_free_slot*)ptr;
#if ZEND_MM_HEAP_PROTECTION
/* Catch the most common double-free pattern for free. */
if (UNEXPECTED(p == heap->free_slot[bin_num])) {
zend_mm_panic("zend_mm_heap corrupted (double free)");
}
#endif
zend_mm_set_next_free_slot(heap, bin_num, p, heap->free_slot[bin_num]);
heap->free_slot[bin_num] = p;
}
Expand Down
Loading