Simplify property check in php_libxml_node_free_resource()

This commit is contained in:
Niels Dossche 2024-04-29 20:45:31 +02:00
parent 974edc7939
commit cf7c592143

View file

@ -1406,17 +1406,7 @@ PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node)
default:
if (node->parent == NULL || node->type == XML_NAMESPACE_DECL) {
php_libxml_node_free_list((xmlNodePtr) node->children);
switch (node->type) {
/* Skip property freeing for the following types */
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:
if (node->type == XML_ELEMENT_NODE) {
php_libxml_node_free_list((xmlNodePtr) node->properties);
}
php_libxml_unregister_node(node);