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/reflection/php_reflection.c | |
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/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 47aefa5d37..63e1f83f58 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -240,9 +240,7 @@ static void reflection_objects_clone(void *object, void **object_clone TSRMLS_DC reflection_object **intern_clone = (reflection_object **) object_clone; *intern_clone = emalloc(sizeof(reflection_object)); - (*intern_clone)->zo.ce = intern->zo.ce; - (*intern_clone)->zo.guards = NULL; - ALLOC_HASHTABLE((*intern_clone)->zo.properties); + zend_object_std_init(&(*intern_clone)->zo, intern->zo.ce TSRMLS_CC); (*intern_clone)->ptr = intern->ptr; (*intern_clone)->free_ptr = intern->free_ptr; (*intern_clone)->obj = intern->obj; @@ -264,8 +262,7 @@ static zend_object_value reflection_objects_new(zend_class_entry *class_type TSR intern->obj = NULL; intern->free_ptr = 0; - ALLOC_HASHTABLE(intern->zo.properties); - zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0); + zend_object_std_init(&intern->zo, class_type TSRMLS_CC); zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); retval.handle = zend_objects_store_put(intern, NULL, reflection_free_objects_storage, reflection_objects_clone TSRMLS_CC); retval.handlers = &reflection_object_handlers; |