mirror of
https://github.com/php/php-src.git
synced 2025-01-27 14:13:41 +08:00
Fixed small leaks in array_map() in case the first parameter is NULL like
array_map(NULL, array(...));
This commit is contained in:
parent
449029d2df
commit
f962ba6abb
@ -3418,6 +3418,8 @@ PHP_FUNCTION(array_map)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
RETVAL_NULL();
|
||||
|
||||
callback = *args[0];
|
||||
if (Z_TYPE_P(callback) != IS_NULL) {
|
||||
if (!zend_is_callable(callback, 0, &callback_name)) {
|
||||
@ -3438,6 +3440,7 @@ PHP_FUNCTION(array_map)
|
||||
if (Z_TYPE_PP(args[i+1]) != IS_ARRAY) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d should be an array", i + 2);
|
||||
efree(array_len);
|
||||
efree(array_pos);
|
||||
efree(args);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user