Skip to content

Commit b6cca30

Browse files
committed
Fixed memory leak
1 parent 738346f commit b6cca30

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Zend/zend_exceptions.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ void zend_exception_set_previous(zval *add_previous TSRMLS_DC)
5252
previous = zend_read_property(default_exception_ce, exception, "previous", sizeof("previous")-1, 1 TSRMLS_CC);
5353
if (Z_TYPE_P(previous) == IS_NULL) {
5454
zend_update_property(default_exception_ce, exception, "previous", sizeof("previous")-1, add_previous TSRMLS_CC);
55+
Z_DELREF_P(add_previous);
5556
return;
5657
}
5758
exception = previous;

ext/spl/tests/iterator_041b.phpt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,10 @@ State 3: valid()
101101
State 4: current()
102102
State 5: key()
103103
State 6: next()
104-
105-
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
104+
===iterator_count===
105+
State 0: __construct()
106+
State 1: __construct()
107+
State 2: rewind()
108+
State 3: valid()
109+
State 6: next()
110+
===DONE===

0 commit comments

Comments
 (0)