diff options
author | Antony Dovgal <tony2001@php.net> | 2006-03-29 14:28:43 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2006-03-29 14:28:43 +0000 |
commit | 59b8592c8cb51599147f990ad8b61d8d02cfce05 (patch) | |
tree | 9bf669097b48484400efe53cb52ff567c51ff8e7 /ext/xsl | |
parent | 697c652001257e04a5af0f047017fe20f62ee969 (diff) | |
download | php-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/xsl')
-rw-r--r-- | ext/xsl/php_xsl.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c index 229492f49b..a408b95f9a 100644 --- a/ext/xsl/php_xsl.c +++ b/ext/xsl/php_xsl.c @@ -80,8 +80,7 @@ void xsl_objects_free_storage(void *object TSRMLS_DC) { xsl_object *intern = (xsl_object *)object; - zend_hash_destroy(intern->std.properties); - FREE_HASHTABLE(intern->std.properties); + zend_object_std_dtor(&intern->std TSRMLS_CC); zend_hash_destroy(intern->parameter); FREE_HASHTABLE(intern->parameter); @@ -119,8 +118,6 @@ zend_object_value xsl_objects_new(zend_class_entry *class_type TSRMLS_DC) zval *tmp; intern = emalloc(sizeof(xsl_object)); - intern->std.ce = class_type; - intern->std.guards = NULL; intern->ptr = NULL; intern->prop_handler = NULL; intern->parameter = NULL; @@ -130,8 +127,7 @@ zend_object_value xsl_objects_new(zend_class_entry *class_type TSRMLS_DC) intern->node_list = NULL; intern->doc = NULL; - ALLOC_HASHTABLE(intern->std.properties); - zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); + zend_object_std_init(&intern->std, class_type TSRMLS_CC); zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); ALLOC_HASHTABLE(intern->parameter); zend_hash_init(intern->parameter, 0, NULL, ZVAL_PTR_DTOR, 0); |