mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fixed bug #46205 (Closure - Memory leaks when ReflectionException is thrown)
This commit is contained in:
parent
a16bcaeb4b
commit
f656c6fc70
3 changed files with 28 additions and 0 deletions
|
@ -1975,6 +1975,12 @@ ZEND_METHOD(reflection_parameter, __construct)
|
|||
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 @@ ZEND_METHOD(reflection_parameter, __construct)
|
|||
}
|
||||
}
|
||||
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 */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue