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

Fix memory leaks in xmlParseStartTag2 error paths

Found by OSS-Fuzz.
This commit is contained in:
Nick Wellnhofer 2019-01-07 17:58:32 +01:00
parent 6b49db2cb2
commit b48226f78c

View File

@ -9247,7 +9247,8 @@ xmlParseStartTag2(xmlParserCtxtPtr ctxt, const xmlChar **pref,
xmlErrMemory(ctxt, "dictionary allocation failure");
if ((attvalue != NULL) && (alloc != 0))
xmlFree(attvalue);
return(NULL);
localname = NULL;
goto done;
}
if (*URL != 0) {
uri = xmlParseURI((const char *) URL);
@ -9497,7 +9498,8 @@ next_attr:
if ((atts == NULL) || (nbatts + 5 > maxatts)) {
if (xmlCtxtGrowAttrs(ctxt, nbatts + 5) < 0) {
return(NULL);
localname = NULL;
goto done;
}
maxatts = ctxt->maxatts;
atts = ctxt->atts;