[php-src] master: Simplify property check in php_libxml_node_free_resource()

From: Date: Tue, 30 Apr 2024 15:29:35 +0000
Subject: [php-src] master: Simplify property check in php_libxml_node_free_resource()
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-128266@lists.php.net to get a copy of this message
Author: Niels Dossche (nielsdos) Date: 2024-04-30T17:29:19+02:00 Commit: https://github.com/php/php-src/commit/cf7c5921436caa718e9c07fb8ce9b8d56b7333ed Raw diff: https://github.com/php/php-src/commit/cf7c5921436caa718e9c07fb8ce9b8d56b7333ed.diff Simplify property check in php_libxml_node_free_resource() Changed paths: M ext/libxml/libxml.c Diff: diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 5fec0fa7ba3c..e32e46a6480f 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);

« previous php.cvs (#128266) next »