mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
- null deref fix
This commit is contained in:
parent
555e42fb5a
commit
44b9942ef3
1 changed files with 11 additions and 1 deletions
|
@ -241,6 +241,10 @@ static zend_mm_storage* zend_mm_mem_win32_init(void *params)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
storage = (zend_mm_storage*)malloc(sizeof(zend_mm_storage));
|
storage = (zend_mm_storage*)malloc(sizeof(zend_mm_storage));
|
||||||
|
if (storage == NULL) {
|
||||||
|
HeapDestroy(heap);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
storage->data = (void*) heap;
|
storage->data = (void*) heap;
|
||||||
return storage;
|
return storage;
|
||||||
}
|
}
|
||||||
|
@ -1066,7 +1070,13 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers,
|
||||||
storage->handlers = handlers;
|
storage->handlers = handlers;
|
||||||
|
|
||||||
heap = malloc(sizeof(struct _zend_mm_heap));
|
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->storage = storage;
|
||||||
heap->block_size = block_size;
|
heap->block_size = block_size;
|
||||||
heap->compact_size = 0;
|
heap->compact_size = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue