- Fix memleak

This commit is contained in:
Marcus Boerger 2005-12-22 00:35:37 +00:00
parent c01d79b2df
commit 53e37ac843

View File

@ -384,6 +384,9 @@ SPL_METHOD(RecursiveIteratorIterator, __construct)
iterator = NULL;
}
if (!iterator || !instanceof_function(Z_OBJCE_P(iterator), spl_ce_RecursiveIterator TSRMLS_CC)) {
if (iterator && !inc_refcount) {
zval_ptr_dtor(&iterator);
}
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
zend_throw_exception(spl_ce_InvalidArgumentException, "An instance of RecursiveIterator or IteratorAggregate creating it is required", 0 TSRMLS_CC);
return;