mirror of
https://github.com/php-win-ext/php-lua.git
synced 2026-03-24 00:52:12 +01:00
Merge pull request #33 from sgolemon/object.alloc
Fix allocation of lua object.
This commit is contained in:
7
lua.c
7
lua.c
@@ -197,12 +197,7 @@ zend_object *php_lua_create_object(zend_class_entry *ce)
|
||||
|
||||
lua_atpanic(L, php_lua_atpanic);
|
||||
|
||||
intern = emalloc(sizeof(php_lua_object) + sizeof(zval) * (ce->default_properties_count - 1));
|
||||
|
||||
if (!intern) {
|
||||
php_error_docref(NULL, E_ERROR, "alloc memory for lua object failed");
|
||||
}
|
||||
|
||||
intern = ecalloc(1, sizeof(php_lua_object) + zend_object_properties_size(ce));
|
||||
intern->L = L;
|
||||
|
||||
zend_object_std_init(&intern->obj, ce);
|
||||
|
||||
Reference in New Issue
Block a user