]> granicus.if.org Git - php/commitdiff
Fixed memory leak
authorDmitry Stogov <dmitry@php.net>
Tue, 29 Jul 2008 14:27:31 +0000 (14:27 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 29 Jul 2008 14:27:31 +0000 (14:27 +0000)
Zend/zend_exceptions.c
ext/spl/tests/iterator_041b.phpt

index 0eaf8fff1f4eaa7450a319641d66a46f1a1adbf2..2696d66091c46ef92552a464617c1065f2b25a8e 100644 (file)
@@ -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;
index f07164d08a898c25a7df1129a1d60755b602ab61..e166f6bdce2dc11ef811fa572f6a310006158091 100755 (executable)
@@ -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===