diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 5fec0fa7ba3..e32e46a6480 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -1406,18 +1406,8 @@ 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: - php_libxml_node_free_list((xmlNodePtr) node->properties); + if (node->type == XML_ELEMENT_NODE) { + php_libxml_node_free_list((xmlNodePtr) node->properties); } php_libxml_unregister_node(node); php_libxml_node_free(node);