summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2008-07-29 14:27:31 +0000
committerDmitry Stogov <dmitry@php.net>2008-07-29 14:27:31 +0000
commit03ebd363850bb365d52616ca4d7f20cd92a56394 (patch)
tree646b0debc43b6a686b10ce29bad7b0b78a160e50
parentd739f8f0da727b75db897d7ab5c28923aa9c50e9 (diff)
downloadphp-git-03ebd363850bb365d52616ca4d7f20cd92a56394.tar.gz
Fixed memory leak
-rw-r--r--Zend/zend_exceptions.c1
-rwxr-xr-xext/spl/tests/iterator_041b.phpt9
2 files changed, 8 insertions, 2 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index 0eaf8fff1f..2696d66091 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===