diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-08-26 15:31:26 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-08-26 15:39:32 +0200 |
commit | 1b7ee6db884b7574893bc737a6f7fb5fdf9d619b (patch) | |
tree | 059e0de1d86d6924b645f40b1fd5e9b71b831a82 | |
parent | 75ac3f1cbabf0a88a092abcc31635a91215912de (diff) | |
download | php-git-1b7ee6db884b7574893bc737a6f7fb5fdf9d619b.tar.gz |
Fix com_safearray_proxy related memory management issues
-rw-r--r-- | ext/com_dotnet/com_saproxy.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c index bde1986992..fa6ee34762 100644 --- a/ext/com_dotnet/com_saproxy.c +++ b/ext/com_dotnet/com_saproxy.c @@ -114,6 +114,8 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval * 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); @@ -387,7 +389,7 @@ static zend_object* saproxy_clone(zval *object) memcpy(cloneproxy, proxy, sizeof(*cloneproxy)); Z_ADDREF_P(cloneproxy->zobj); - 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; @@ -437,7 +439,7 @@ int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index) } Z_ADDREF_P(proxy->zobj); - 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); |