diff options
| author | Dmitry Stogov <dmitry@php.net> | 2010-08-16 08:11:08 +0000 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@php.net> | 2010-08-16 08:11:08 +0000 |
| commit | 890c709036207999d814ad5dbe407a94dcec3f84 (patch) | |
| tree | c81608dd3a4faa30aa834ba7d8fb008c52444111 /Zend/zend_exceptions.c | |
| parent | 61a1bad720c569d4580101b737ad65f312a36282 (diff) | |
| download | php-git-890c709036207999d814ad5dbe407a94dcec3f84.tar.gz | |
Fixed memory leaks (related to bug #52361)
Diffstat (limited to 'Zend/zend_exceptions.c')
| -rw-r--r-- | Zend/zend_exceptions.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 178ef50e7c..8a84c78db9 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -572,6 +572,7 @@ ZEND_METHOD(exception, __toString) zend_call_function(&fci, NULL TSRMLS_CC); if (Z_TYPE_P(trace) != IS_STRING) { + zval_ptr_dtor(&trace); trace = NULL; } @@ -592,6 +593,10 @@ ZEND_METHOD(exception, __toString) zval_dtor(&line); exception = zend_read_property(default_exception_ce, exception, "previous", sizeof("previous")-1, 0 TSRMLS_CC); + + if (trace) { + zval_ptr_dtor(&trace); + } } zval_dtor(&fname); @@ -599,10 +604,6 @@ ZEND_METHOD(exception, __toString) * the result in uncaught exception handlers without memleaks. */ zend_update_property_string(default_exception_ce, getThis(), "string", sizeof("string")-1, str TSRMLS_CC); - if (trace) { - zval_ptr_dtor(&trace); - } - RETURN_STRINGL(str, len, 0); } /* }}} */ |
