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:
parent
6b49db2cb2
commit
b48226f78c
6
parser.c
6
parser.c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user