Skip to content

Commit

Permalink
Fix valgrind warnings
Browse files Browse the repository at this point in the history
Duplicate (MAKE_STD_ZVAL + ZVAL_ZVAL) params in php7 compatible
implementation of call_user_function.
  • Loading branch information
yatsukhnenko committed Aug 1, 2017
1 parent b624a8b commit 1ab89e1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions common.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,19 @@ inline_call_user_function(HashTable *function_table, zval *object, zval *functio
if (!params) param_count = 0;
if (param_count > 0) {
_params = ecalloc(param_count, sizeof(zval *));
for (i = 0; i < param_count; i++) {
_params[i] = &params[i];
INIT_PZVAL(_params[i]);
for (i = 0; i < param_count; ++i) {
zval *zv = &params[i];
MAKE_STD_ZVAL(_params[i]);
ZVAL_ZVAL(_params[i], zv, 1, 0);
}
}
ret = _call_user_function(function_table, &object, function_name, retval_ptr, param_count, _params TSRMLS_CC);
if (_params) efree(_params);
if (_params) {
for (i = 0; i < param_count; ++i) {
zval_ptr_dtor(&_params[i]);
}
efree(_params);
}
return ret;
}

Expand Down

0 comments on commit 1ab89e1

Please sign in to comment.