return NULL;
}
storage = (zend_mm_storage*)malloc(sizeof(zend_mm_storage));
+ if (storage == NULL) {
+ HeapDestroy(heap);
+ return NULL;
+ }
storage->data = (void*) heap;
return storage;
}
storage->handlers = handlers;
heap = malloc(sizeof(struct _zend_mm_heap));
-
+ if (heap == NULL) {
+ fprintf(stderr, "Cannot allocate heap for zend_mm storage [%s]\n", handlers->name);
+#ifdef PHP_WIN32
+ fflush(stderr);
+#endif
+ exit(255);
+ }
heap->storage = storage;
heap->block_size = block_size;
heap->compact_size = 0;