From: Dmitry Stogov Date: Tue, 29 Jul 2008 14:28:11 +0000 (+0000) Subject: Fixed memory leak X-Git-Tag: php-5.3.0alpha1~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6cca302116e9c3e1f8ef5d77699c05b94226de7;p=php Fixed memory leak --- diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 5f725a4b72..90b00d76d4 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -52,6 +52,7 @@ void zend_exception_set_previous(zval *add_previous TSRMLS_DC) previous = zend_read_property(default_exception_ce, exception, "previous", sizeof("previous")-1, 1 TSRMLS_CC); if (Z_TYPE_P(previous) == IS_NULL) { zend_update_property(default_exception_ce, exception, "previous", sizeof("previous")-1, add_previous TSRMLS_CC); + Z_DELREF_P(add_previous); return; } exception = previous; diff --git a/ext/spl/tests/iterator_041b.phpt b/ext/spl/tests/iterator_041b.phpt index f07164d08a..e166f6bdce 100755 --- a/ext/spl/tests/iterator_041b.phpt +++ b/ext/spl/tests/iterator_041b.phpt @@ -101,5 +101,10 @@ State 3: valid() State 4: current() State 5: key() State 6: next() - -Fatal error: Ignoring exception from MyArrayIterator::__destruct() while an exception is already active (Uncaught Exception in %s on line %d) in %siterator_041b.php on line %d +===iterator_count=== +State 0: __construct() +State 1: __construct() +State 2: rewind() +State 3: valid() +State 6: next() +===DONE===