rrichards Wed Jun 18 13:42:39 2003 EDT
Modified files:
/php4/ext/domxml php_domxml.c
Log:
Fix for bug #24219 segfault during resource destruction
Used bug fix to optimize free_doc routine
Index: php4/ext/domxml/php_domxml.c
diff -u php4/ext/domxml/php_domxml.c:1.257 php4/ext/domxml/php_domxml.c:1.258
--- php4/ext/domxml/php_domxml.c:1.257 Tue Jun 10 16:03:27 2003
+++ php4/ext/domxml/php_domxml.c Wed Jun 18 13:42:39 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_domxml.c,v 1.257 2003/06/10 20:03:27 imajes Exp $ */
+/* $Id: php_domxml.c,v 1.258 2003/06/18 17:42:39 rrichards Exp $ */
/* TODO
* - Support Notation Nodes
@@ -729,7 +729,7 @@
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 @@
/* 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 @@
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 @@
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;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php