]> granicus.if.org Git - php/commitdiff
- MFB Fix leak
authorMarcus Boerger <helly@php.net>
Thu, 22 Dec 2005 00:38:05 +0000 (00:38 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 22 Dec 2005 00:38:05 +0000 (00:38 +0000)
ext/spl/spl_iterators.c

index f1e8ecde2f6df1b60921dd56dfbe1f81e3cab11a..764194645adcb8ff9d697ff5c4003a171f6320d8 100755 (executable)
@@ -386,6 +386,9 @@ SPL_METHOD(RecursiveIteratorIterator, __construct)
                iterator = NULL;
        }
        if (!iterator || !instanceof_function(Z_OBJCE_P(iterator), U_CLASS_ENTRY(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(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), "An instance of RecursiveIterator or IteratorAggregate creating it is required", 0 TSRMLS_CC);
                return;