summaryrefslogtreecommitdiff
path: root/Zend/zend_mm.c
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2002-06-22 16:09:15 +0000
committerAndi Gutmans <andi@php.net>2002-06-22 16:09:15 +0000
commit7f226a6b199f8df969f0f46def6a26dbd4a75265 (patch)
tree1ceb8f8497002f114516c7ec473c37bd92e77388 /Zend/zend_mm.c
parent58ce28e58893b8846e2f0c1a53020dcf877e6b8b (diff)
downloadphp-git-7f226a6b199f8df969f0f46def6a26dbd4a75265.tar.gz
- Fix crash when zend_mm_shutdown is called more than once.
Diffstat (limited to 'Zend/zend_mm.c')
-rw-r--r--Zend/zend_mm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Zend/zend_mm.c b/Zend/zend_mm.c
index d418204340..5a6d9d2461 100644
--- a/Zend/zend_mm.c
+++ b/Zend/zend_mm.c
@@ -104,6 +104,7 @@ zend_bool zend_mm_add_memory_block(zend_mm_heap *heap, size_t block_size)
if (!segment) {
return 1;
}
+/* fprintf(stderr, "Allocating segment %X\n", segment); */
segment->next_segment = heap->segments_list;
heap->segments_list = segment;
@@ -147,8 +148,10 @@ void zend_mm_shutdown(zend_mm_heap *heap)
while (segment) {
prev = segment;
segment = segment->next_segment;
+/* fprintf(stderr, "Freeing segment %X\n", prev);*/
free(prev);
}
+ heap->segments_list = NULL;
}
void *zend_mm_alloc(zend_mm_heap *heap, size_t size)