diff options
author | Rob Richards <rrichards@php.net> | 2003-06-18 17:42:39 +0000 |
---|---|---|
committer | Rob Richards <rrichards@php.net> | 2003-06-18 17:42:39 +0000 |
commit | e4c67c0035ab1ef4da2d26c5093c2cb486782cd1 (patch) | |
tree | 62e4cb9aaa2621adc18468496e8acde097e0ca1d /ext/domxml | |
parent | be4947b0e6194f3636dd326f7fa43df1d6a5391e (diff) | |
download | php-git-e4c67c0035ab1ef4da2d26c5093c2cb486782cd1.tar.gz |
Fix for bug #24219 segfault during resource destruction
Used bug fix to optimize free_doc routine
Diffstat (limited to 'ext/domxml')
-rw-r--r-- | ext/domxml/php_domxml.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index a20abdc933..a00ecb947e 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -729,7 +729,7 @@ static void php_free_xml_doc(zend_rsrc_list_entry *rsrc TSRMLS_DC) xmlDoc *doc = (xmlDoc *) rsrc->ptr; if (doc) { - node_list_wrapper_dtor(doc->children, 0 TSRMLS_CC); + node_list_wrapper_dtor(doc->children, 1 TSRMLS_CC); node_wrapper_dtor((xmlNodePtr) doc); xmlFreeDoc(doc); } @@ -745,8 +745,8 @@ static void php_free_xml_node(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* Attribute Nodes ccontain accessible children attr_list_wrapper_dtor(node->properties); */ xmlSetTreeDoc(node, NULL); - node_list_wrapper_dtor((xmlNodePtr) node->properties, 0 TSRMLS_CC); - node_list_wrapper_dtor(node->children, 0 TSRMLS_CC); + node_list_wrapper_dtor((xmlNodePtr) node->properties, 1 TSRMLS_CC); + node_list_wrapper_dtor(node->children, 1 TSRMLS_CC); node_wrapper_dtor(node); xmlFreeNode(node); } else { @@ -759,7 +759,7 @@ static void php_free_xml_attr(zend_rsrc_list_entry *rsrc TSRMLS_DC) xmlNodePtr node = (xmlNodePtr) rsrc->ptr; if (node->parent == NULL) { /* Attribute Nodes contain accessible children */ - node_list_wrapper_dtor(node->children, 0 TSRMLS_CC); + node_list_wrapper_dtor(node->children, 1 TSRMLS_CC); node_wrapper_dtor(node); xmlFreeProp((xmlAttrPtr) node); } else { @@ -4488,10 +4488,10 @@ PHP_FUNCTION(domxml_doc_free_doc) RETURN_FALSE; } + /* No need to do this as php_free_xml_doc will kill the children node_list_wrapper_dtor(docp->children, 1 TSRMLS_CC); node_list_wrapper_dtor((xmlNodePtr) docp->properties, 1 TSRMLS_CC); - /* Attribute Nodes ccontain accessible children - attr_list_wrapper_dtor(docp->properties); */ + */ node_wrapper_free(docp TSRMLS_CC); RETURN_TRUE; |