Skip to content

Get rid of return value for php_libxml_unregister_node() #11398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 8, 2023
Merged
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
12 changes: 3 additions & 9 deletions ext/libxml/libxml.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static int php_libxml_clear_object(php_libxml_node_object *object)
return php_libxml_decrement_doc_ref(object);
}

static int php_libxml_unregister_node(xmlNodePtr nodep)
static void php_libxml_unregister_node(xmlNodePtr nodep)
{
php_libxml_node_object *wrapper;

Expand All @@ -130,8 +130,6 @@ static int php_libxml_unregister_node(xmlNodePtr nodep)
nodeptr->node = NULL;
}
}

return -1;
}

static void php_libxml_node_free(xmlNodePtr node)
Expand Down Expand Up @@ -209,9 +207,7 @@ PHP_LIBXML_API void php_libxml_node_free_list(xmlNodePtr node)

curnode = node->next;
xmlUnlinkNode(node);
if (php_libxml_unregister_node(node) == 0) {
node->doc = NULL;
}
php_libxml_unregister_node(node);
php_libxml_node_free(node);
}
}
Expand Down Expand Up @@ -1270,9 +1266,7 @@ PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node)
default:
php_libxml_node_free_list((xmlNodePtr) node->properties);
}
if (php_libxml_unregister_node(node) == 0) {
node->doc = NULL;
}
php_libxml_unregister_node(node);
php_libxml_node_free(node);
} else {
php_libxml_unregister_node(node);
Expand Down