From: Ilia Alshanetsky Date: Tue, 6 Jan 2004 22:44:40 +0000 (+0000) Subject: Check if realloc() succeeds or not. (Noticed by Andrey) X-Git-Tag: php_ibase_before_split~371 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=68a096f84eb380dd7f9250a207d338f4fe02a01b;p=php Check if realloc() succeeds or not. (Noticed by Andrey) --- diff --git a/Zend/zend_mm.c b/Zend/zend_mm.c index 04102720ef..0a9793e399 100644 --- a/Zend/zend_mm.c +++ b/Zend/zend_mm.c @@ -408,6 +408,9 @@ void *zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size) /* segment size, size of block and size of guard block */ realloc_to_size = ZEND_MM_ALIGNED_SEGMENT_SIZE+true_size+ZEND_MM_ALIGNED_HEADER_SIZE; segment = realloc(segment, realloc_to_size); + if (!segment) { + return NULL; + } if (segment != segment_copy) { if (heap->segments_list == segment_copy) {