mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Simplify property check in php_libxml_node_free_resource()
This commit is contained in:
parent
974edc7939
commit
cf7c592143
1 changed files with 2 additions and 12 deletions
|
@ -1406,18 +1406,8 @@ PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node)
|
||||||
default:
|
default:
|
||||||
if (node->parent == NULL || node->type == XML_NAMESPACE_DECL) {
|
if (node->parent == NULL || node->type == XML_NAMESPACE_DECL) {
|
||||||
php_libxml_node_free_list((xmlNodePtr) node->children);
|
php_libxml_node_free_list((xmlNodePtr) node->children);
|
||||||
switch (node->type) {
|
if (node->type == XML_ELEMENT_NODE) {
|
||||||
/* Skip property freeing for the following types */
|
php_libxml_node_free_list((xmlNodePtr) node->properties);
|
||||||
case XML_ATTRIBUTE_DECL:
|
|
||||||
case XML_DTD_NODE:
|
|
||||||
case XML_DOCUMENT_TYPE_NODE:
|
|
||||||
case XML_ENTITY_DECL:
|
|
||||||
case XML_ATTRIBUTE_NODE:
|
|
||||||
case XML_NAMESPACE_DECL:
|
|
||||||
case XML_TEXT_NODE:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
php_libxml_node_free_list((xmlNodePtr) node->properties);
|
|
||||||
}
|
}
|
||||||
php_libxml_unregister_node(node);
|
php_libxml_unregister_node(node);
|
||||||
php_libxml_node_free(node);
|
php_libxml_node_free(node);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue