1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

Fix memory leak in xmlSAX2StartElement

Introduced by a recent commit. Only happens if max depth is exceeded
in SAX1 mode.

Found by OSS-Fuzz.
This commit is contained in:
Nick Wellnhofer 2019-01-07 17:14:21 +01:00
parent 26828cb3a1
commit 6b49db2cb2

2
SAX2.c
View File

@ -1668,6 +1668,8 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
if (nodePush(ctxt, ret) < 0) {
xmlUnlinkNode(ret);
xmlFreeNode(ret);
if (prefix != NULL)
xmlFree(prefix);
return;
}