summaryrefslogtreecommitdiff
path: root/ext/com_dotnet/com_saproxy.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-08-26 15:43:43 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-08-26 15:43:43 +0200
commit00edc3f4bce188b6804b692026361b3f79820d80 (patch)
treebc30826982fbcdc2f8649aef9e294f662567c8a5 /ext/com_dotnet/com_saproxy.c
parent55798e0e391d18d7e7d321c1149b12aa89d7d4ff (diff)
parent8e2f219fad5dba2c4c5f83bcc770df5697cb71d3 (diff)
downloadphp-git-00edc3f4bce188b6804b692026361b3f79820d80.tar.gz
Merge branch 'PHP-7.4' into master
* PHP-7.4: Fix com_safearray_proxy related memory management issues
Diffstat (limited to 'ext/com_dotnet/com_saproxy.c')
-rw-r--r--ext/com_dotnet/com_saproxy.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c
index d86fb75e3e..dbb00b1596 100644
--- a/ext/com_dotnet/com_saproxy.c
+++ b/ext/com_dotnet/com_saproxy.c
@@ -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);