mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-23 01:52:48 +03:00
malloc-fail: Fix memory leak in xmlCopyPropList
Found with libFuzzer, see #344.
This commit is contained in:
4
tree.c
4
tree.c
@@ -4231,8 +4231,10 @@ xmlCopyPropList(xmlNodePtr target, xmlAttrPtr cur) {
|
|||||||
return(NULL);
|
return(NULL);
|
||||||
while (cur != NULL) {
|
while (cur != NULL) {
|
||||||
q = xmlCopyProp(target, cur);
|
q = xmlCopyProp(target, cur);
|
||||||
if (q == NULL)
|
if (q == NULL) {
|
||||||
|
xmlFreePropList(ret);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
}
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
ret = p = q;
|
ret = p = q;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user