Skip to content

Commit

Permalink
Drop useless allocation in php_filter_callback
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jul 4, 2017
1 parent 8126599 commit 3f8ceb6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ext/filter/callback_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
{
zval retval;
zval *args;
zval args[1];
int status;

if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, NULL)) {
Expand All @@ -33,7 +33,6 @@ void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
return;
}

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

Expand All @@ -46,7 +45,6 @@ void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
}

zval_ptr_dtor(&args[0]);
efree(args);
}

/*
Expand Down

0 comments on commit 3f8ceb6

Please sign in to comment.