summaryrefslogtreecommitdiff
path: root/ext/com_dotnet
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-03-29 14:28:43 +0000
committerAntony Dovgal <tony2001@php.net>2006-03-29 14:28:43 +0000
commit59b8592c8cb51599147f990ad8b61d8d02cfce05 (patch)
tree9bf669097b48484400efe53cb52ff567c51ff8e7 /ext/com_dotnet
parent697c652001257e04a5af0f047017fe20f62ee969 (diff)
downloadphp-git-59b8592c8cb51599147f990ad8b61d8d02cfce05.tar.gz
fix bug #36898 (__set() leaks in classes extending internal ones)
Added: ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC) ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC) to initialize and destroy zend_object structs
Diffstat (limited to 'ext/com_dotnet')
-rwxr-xr-xext/com_dotnet/com_persist.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index c1c71fcf4e..8408d619d9 100755
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -708,8 +708,7 @@ static void helper_free_storage(void *obj TSRMLS_DC)
if (object->unk) {
IUnknown_Release(object->unk);
}
- zend_hash_destroy(object->std.properties);
- FREE_HASHTABLE(object->std.properties);
+ zend_object_std_dtor(&object->std TSRMLS_CC);
efree(object);
}
@@ -722,9 +721,8 @@ static void helper_clone(void *obj, void **clone_ptr TSRMLS_DC)
memcpy(clone, object, sizeof(*object));
*clone_ptr = clone;
- ALLOC_HASHTABLE(clone->std.properties);
- zend_hash_init(clone->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
-
+ zend_object_std_init(&clone->std, object->std.ce TSRMLS_CC);
+
if (clone->ipf) {
IPersistFile_AddRef(clone->ipf);
}
@@ -747,9 +745,7 @@ static zend_object_value helper_new(zend_class_entry *ce TSRMLS_DC)
helper = emalloc(sizeof(*helper));
memset(helper, 0, sizeof(*helper));
- ALLOC_HASHTABLE(helper->std.properties);
- zend_hash_init(helper->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
- helper->std.ce = helper_ce;
+ zend_object_std_init(&helper->std, helper_ce TSRMLS_CC);
retval.handle = zend_objects_store_put(helper, NULL, helper_free_storage, helper_clone TSRMLS_CC);
retval.handlers = &helper_handlers;