From: Ilia Alshanetsky Date: Tue, 17 Feb 2009 17:09:05 +0000 (+0000) Subject: Fixed bug #45327 (memory leak if offsetGet throws exception) X-Git-Tag: php-5.2.9RC3~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=013c7f1f922fce5e982855a62ee60ac943dda55c;p=php Fixed bug #45327 (memory leak if offsetGet throws exception) # Patch by Greg --- diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 5da47bb490..9fd7db1b80 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -472,6 +472,10 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) } return 0; } + if (EG(exception)) { + zval_ptr_dtor(&retval); + return 0; + } /* Undo PZVAL_LOCK() */ retval->refcount--;