Skip to content

Commit 3f8ceb6

Browse files
committed
Drop useless allocation in php_filter_callback
1 parent 8126599 commit 3f8ceb6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

ext/filter/callback_filter.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
2424
{
2525
zval retval;
26-
zval *args;
26+
zval args[1];
2727
int status;
2828

2929
if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, NULL)) {
@@ -33,7 +33,6 @@ void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
3333
return;
3434
}
3535

36-
args = safe_emalloc(sizeof(zval), 1, 0);
3736
ZVAL_COPY(&args[0], value);
3837
status = call_user_function_ex(EG(function_table), NULL, option_array, &retval, 1, args, 0, NULL);
3938

@@ -46,7 +45,6 @@ void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
4645
}
4746

4847
zval_ptr_dtor(&args[0]);
49-
efree(args);
5048
}
5149

5250
/*

0 commit comments

Comments
 (0)