fix incorrect type alloc that causes memory corruption

This commit is contained in:
Antony Dovgal
2019-05-22 16:53:39 +03:00
parent 24fd1baf19
commit d763f167d8

View File

@@ -75,7 +75,7 @@ PHP_METHOD(lua_closure, invoke) {
zval rv;
if (ZEND_NUM_ARGS()) {
arguments = emalloc(sizeof(zval*) * ZEND_NUM_ARGS());
arguments = emalloc(sizeof(zval) * ZEND_NUM_ARGS());
if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), arguments) == FAILURE) {
efree(arguments);
zend_throw_exception_ex(NULL, 0, "cannot get arguments for calling closure");