Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ext/dom/attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@ PHP_METHOD(DOMAttr, isId)

bool dom_compare_value(const xmlAttr *attr, const xmlChar *value)
{
bool free;
xmlChar *attr_value = php_libxml_attr_value(attr, &free);
bool should_free;
xmlChar *attr_value = php_libxml_attr_value(attr, &should_free);
bool result = xmlStrEqual(attr_value, value);
if (free) {
if (should_free) {
xmlFree(attr_value);
}
return result;
Expand Down
6 changes: 3 additions & 3 deletions ext/dom/php_dom.c
Original file line number Diff line number Diff line change
Expand Up @@ -2396,10 +2396,10 @@ void php_dom_get_content_into_zval(const xmlNode *nodep, zval *return_value, boo
}

case XML_ATTRIBUTE_NODE: {
bool free;
xmlChar *value = php_libxml_attr_value((const xmlAttr *) nodep, &free);
bool should_free;
xmlChar *value = php_libxml_attr_value((const xmlAttr *) nodep, &should_free);
RETVAL_STRING_FAST((const char *) value);
if (free) {
if (should_free) {
xmlFree(value);
}
return;
Expand Down
6 changes: 3 additions & 3 deletions ext/simplexml/simplexml.c
Original file line number Diff line number Diff line change
Expand Up @@ -1529,10 +1529,10 @@ static void sxe_add_registered_namespaces(php_sxe_object *sxe, xmlNodePtr node,
/* Attributes in the xmlns namespace should be treated as namespace declarations too. */
if (attr->ns && xmlStrEqual(attr->ns->href, (const xmlChar *) "http://www.w3.org/2000/xmlns/")) {
const char *prefix = attr->ns->prefix ? (const char *) attr->name : "";
bool free;
xmlChar *href = php_libxml_attr_value(attr, &free);
bool should_free;
xmlChar *href = php_libxml_attr_value(attr, &should_free);
sxe_add_namespace_name_raw(return_value, prefix, (const char *) href);
if (free) {
if (should_free) {
xmlFree(href);
}
}
Expand Down