From: Antony Dovgal Date: Fri, 13 Apr 2007 14:41:36 +0000 (+0000) Subject: fix #41075 (memleak when creating default object caused exception) X-Git-Tag: php-5.2.2RC2~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb0def99a8da652fe36ed7c600dd9773a54a2f98;p=php fix #41075 (memleak when creating default object caused exception) --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index caa0aac2ac..86239fa44a 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -611,7 +611,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode Z_OBJ_HT_P(object)->write_dimension(object, property_name, value TSRMLS_CC); } - if (result && !RETURN_VALUE_UNUSED(result)) { + if (result && !RETURN_VALUE_UNUSED(result) && !EG(exception)) { T(result->u.var).var.ptr = value; T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr; /* this is so that we could use it in FETCH_DIM_R, etc. - see bug #27876 */ PZVAL_LOCK(value);