Re: svn: /php/php-src/ branches/PHP_5_3/ext/standard/basic_functions.c branches/PHP_5_4/ext/standard/basic_functions.c
trunk/ext/standard/basic_functions.c
| From: | Antony Dovgal | Date: | Sun, 07 Aug 2011 13:50:20 +0000 |
| Subject: | Re: svn: /php/php-src/ branches/PHP_5_3/ext/standard/basic_functions.c branches/PHP_5_4/ext/standard/basic_functions.c trunk/ext/standard/basic_functions.c |
||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-65744@lists.php.net to get a copy of this message | ||
On 08/07/2011 05:19 PM, Xinchen Hui wrote:
opts = (opt_struct *) erealloc(opts, sizeof(opt_struct) * (len + count + 1)); + if (!opts) { + RETURN_FALSE; + } +erealloc() cannot return NULL whatever happens and if you look at the sources, you'll notice that nobody ever checks the result of emalloc(), erealloc() or ecalloc(). That's because Zend memory manager shuts down the whole process if it fails to allocate a memory segment. See Zend/zend_alloc.c for details. -- Wbr, Antony Dovgal --- http://pinba.org - realtime profiling for PHP