dmitry Wed Oct 1 07:30:32 2008 UTC
Added files: (Branch: PHP_5_3)
/php-src/ext/reflection/tests bug46205.phpt
Modified files:
/php-src NEWS
/php-src/ext/reflection php_reflection.c
Log:
Fixed bug #46205 (Closure - Memory leaks when ReflectionException is thrown)
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.335&r2=1.2027.2.547.2.965.2.336&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.335
php-src/NEWS:1.2027.2.547.2.965.2.336
--- php-src/NEWS:1.2027.2.547.2.965.2.335 Tue Sep 30 02:41:33 2008
+++ php-src/NEWS Wed Oct 1 07:30:30 2008
@@ -10,6 +10,8 @@
- Fixed bug causing the algorithm parameter of mhash() to be modified. (Scott)
+- Fixed bug #46205 (Closure - Memory leaks when ReflectionException is thrown).
+ (Dmitry)
- Fixed bug #46194 (SIGSEGV when requested file is not found). (Greg)
- Fixed bug #46185 (importNode changes the namespace of an XML element). (Rob)
- Fixed bug #46178 (memory leak in ext/phar). (Greg)
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.45.2.34&r2=1.164.2.33.2.45.2.35&diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.34
php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.35
--- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.34 Fri Aug
22 15:54:21 2008
+++ php-src/ext/reflection/php_reflection.c Wed Oct 1 07:30:31 2008
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.34 2008/08/22 15:54:21 felipe Exp
$ */
+/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.35 2008/10/01 07:30:31 dmitry Exp
$ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1975,6 +1975,12 @@
if (Z_TYPE_PP(parameter) == IS_LONG) {
position= Z_LVAL_PP(parameter);
if (position < 0 || (zend_uint)position >=
fptr->common.num_args) {
+ if (fptr->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) {
+ if (fptr->type != ZEND_OVERLOADED_FUNCTION) {
+ efree(fptr->common.function_name);
+ }
+ efree(fptr);
+ }
_DO_THROW("The parameter specified by its offset could
not be found");
/* returns out of this function */
}
@@ -1990,6 +1996,12 @@
}
}
if (position == -1) {
+ if (fptr->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) {
+ if (fptr->type != ZEND_OVERLOADED_FUNCTION) {
+ efree(fptr->common.function_name);
+ }
+ efree(fptr);
+ }
_DO_THROW("The parameter specified by its name could
not be found");
/* returns out of this function */
}
@@ -5242,7 +5254,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "Reflection", "enabled");
- php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v
1.164.2.33.2.45.2.34 2008/08/22 15:54:21 felipe Exp $");
+ php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v
1.164.2.33.2.45.2.35 2008/10/01 07:30:31 dmitry Exp $");
php_info_print_table_end();
} /* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/bug46205.phpt?view=markup&rev=1.1
Index: php-src/ext/reflection/tests/bug46205.phpt
+++ php-src/ext/reflection/tests/bug46205.phpt
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php