1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-24 21:33:51 +03:00

malloc-fail: Fix memory leak in xmlCopyNamespaceList

Found with libFuzzer, see #344.
This commit is contained in:
Nick Wellnhofer 2023-03-03 13:02:11 +01:00
parent 282b75f110
commit dbc893f588

4
tree.c
View File

@ -4090,6 +4090,10 @@ xmlCopyNamespaceList(xmlNsPtr cur) {
while (cur != NULL) {
q = xmlCopyNamespace(cur);
if (q == NULL) {
xmlFreeNsList(ret);
return(NULL);
}
if (p == NULL) {
ret = p = q;
} else {