summaryrefslogtreecommitdiff
path: root/ext/com_dotnet/com_persist.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-03-02 10:46:31 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2020-03-02 10:46:46 +0100
commitb9843c9418a1325c4e7dfbf678b3e221c815c130 (patch)
treeb1c71c76c28acf9cb0e5fac6298ce527d08782d6 /ext/com_dotnet/com_persist.c
parent533633deda78301c58b360841d02c061f2a6106e (diff)
parent2adf1c4d23467424012db1971d0a0a678d10d782 (diff)
downloadphp-git-b9843c9418a1325c4e7dfbf678b3e221c815c130.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #79332: php_istreams are never freed
Diffstat (limited to 'ext/com_dotnet/com_persist.c')
-rw-r--r--ext/com_dotnet/com_persist.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index f2d60c1e72..3283e59df7 100644
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -248,13 +248,6 @@ static struct IStreamVtbl php_istream_vtbl = {
static void istream_destructor(php_istream *stm)
{
- if (stm->res) {
- zend_resource *res = stm->res;
- stm->res = NULL;
- zend_list_delete(res);
- return;
- }
-
if (stm->refcount > 0) {
CoDisconnectObject((IUnknown*)stm, 0);
}
@@ -268,7 +261,6 @@ static void istream_destructor(php_istream *stm)
PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream)
{
php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm));
- zval *tmp;
if (stm == NULL)
return NULL;
@@ -280,8 +272,7 @@ PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream)
stm->stream = stream;
GC_ADDREF(stream->res);
- tmp = zend_list_insert(stm, le_istream);
- stm->res = Z_RES_P(tmp);
+ stm->res = zend_register_resource(stm, le_istream);
return (IStream*)stm;
}