mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-7.4' into master
* PHP-7.4: Fix com_safearray_proxy related memory management issues
This commit is contained in:
@@ -112,6 +112,8 @@ static zval *saproxy_read_dimension(zend_object *object, zval *offset, int type,
|
||||
Z_STRLEN(proxy->indices[0]), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v,
|
||||
proxy->dimensions, args, 0);
|
||||
|
||||
efree(args);
|
||||
|
||||
if (res == SUCCESS) {
|
||||
php_com_zval_from_variant(rv, &v, proxy->obj->code_page);
|
||||
VariantClear(&v);
|
||||
@@ -372,7 +374,7 @@ static zend_object* saproxy_clone(zend_object *object)
|
||||
memcpy(cloneproxy, proxy, sizeof(*cloneproxy));
|
||||
|
||||
GC_ADDREF(&cloneproxy->obj->zo);
|
||||
cloneproxy->indices = safe_emalloc(cloneproxy->dimensions, sizeof(zval *), 0);
|
||||
cloneproxy->indices = safe_emalloc(cloneproxy->dimensions, sizeof(zval), 0);
|
||||
clone_indices(cloneproxy, proxy, proxy->dimensions);
|
||||
|
||||
return &cloneproxy->std;
|
||||
@@ -422,7 +424,7 @@ int php_com_saproxy_create(zend_object *com_object, zval *proxy_out, zval *index
|
||||
}
|
||||
|
||||
GC_ADDREF(&proxy->obj->zo);
|
||||
proxy->indices = safe_emalloc(proxy->dimensions, sizeof(zval *), 0);
|
||||
proxy->indices = safe_emalloc(proxy->dimensions, sizeof(zval), 0);
|
||||
|
||||
if (rel) {
|
||||
clone_indices(proxy, rel, rel->dimensions);
|
||||
|
||||
Reference in New Issue
Block a user