1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-04-01 10:50:08 +03:00

malloc-fail: Fix memory leak in xmlCopyPropList

Found with libFuzzer, see #344.
This commit is contained in:
Nick Wellnhofer 2023-02-16 11:45:58 +01:00
parent 8d22e06588
commit bc7740b3c3

4
tree.c
View File

@ -4231,8 +4231,10 @@ xmlCopyPropList(xmlNodePtr target, xmlAttrPtr cur) {
return(NULL);
while (cur != NULL) {
q = xmlCopyProp(target, cur);
if (q == NULL)
if (q == NULL) {
xmlFreePropList(ret);
return(NULL);
}
if (p == NULL) {
ret = p = q;
} else {