mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix memory leak introduced by fixing bug #78221
This commit is contained in:
commit
c3ee9d1bb7
1 changed files with 9 additions and 2 deletions
|
@ -1360,6 +1360,14 @@ xmlNode *dom_get_elements_by_tag_name_ns_raw(xmlNodePtr nodep, char *ns, char *l
|
|||
/* }}} */
|
||||
/* }}} end dom_element_get_elements_by_tag_name_ns_raw */
|
||||
|
||||
static inline zend_bool is_empty_node(xmlNodePtr nodep)
|
||||
{
|
||||
xmlChar *strContent = xmlNodeGetContent(nodep);
|
||||
zend_bool ret = strContent == NULL || *strContent == '\0';
|
||||
xmlFree(strContent);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* {{{ void dom_normalize (xmlNodePtr nodep) */
|
||||
void dom_normalize (xmlNodePtr nodep)
|
||||
{
|
||||
|
@ -1385,8 +1393,7 @@ void dom_normalize (xmlNodePtr nodep)
|
|||
break;
|
||||
}
|
||||
}
|
||||
strContent = xmlNodeGetContent(child);
|
||||
if (*strContent == '\0') {
|
||||
if (is_empty_node(child)) {
|
||||
nextp = child->next;
|
||||
xmlUnlinkNode(child);
|
||||
php_libxml_node_free_resource(child);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue