summaryrefslogtreecommitdiff
path: root/ext/simplexml/simplexml.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-03-29 15:08:52 +0000
committerAntony Dovgal <tony2001@php.net>2006-03-29 15:08:52 +0000
commit6a53a49c8b343d63b586ed2ffcd547767f9746c3 (patch)
tree1afe528ffdb39d7accd54bf9ec81c46b914180f2 /ext/simplexml/simplexml.c
parent39392cce19b718b272e8e758f64d9124530fde49 (diff)
downloadphp-git-6a53a49c8b343d63b586ed2ffcd547767f9746c3.tar.gz
MF51: 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)
Diffstat (limited to 'ext/simplexml/simplexml.c')
-rw-r--r--ext/simplexml/simplexml.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 70182def08..d6e75004eb 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1752,9 +1752,8 @@ static void sxe_object_free_storage(void *object TSRMLS_DC)
sxe = (php_sxe_object *) object;
- zend_hash_destroy(sxe->zo.properties);
- FREE_HASHTABLE(sxe->zo.properties);
-
+ zend_object_std_dtor(&sxe->zo TSRMLS_CC);
+
php_libxml_node_decrement_resource((php_libxml_node_object *)sxe TSRMLS_CC);
if (sxe->xpath) {
@@ -1777,14 +1776,12 @@ static php_sxe_object* php_sxe_object_new(zend_class_entry *ce TSRMLS_DC)
php_sxe_object *intern;
intern = ecalloc(1, sizeof(php_sxe_object));
- intern->zo.ce = ce;
intern->iter.type = SXE_ITER_NONE;
intern->iter.nsprefix = NULL;
intern->iter.name = NULL;
- ALLOC_HASHTABLE(intern->zo.properties);
- zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_object_std_init(&intern->zo, ce TSRMLS_CC);
return intern;
}