mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-11 21:41:53 +03:00
malloc-fail: Fix memory leak in htmlCreateMemoryParserCtxt
Found with libFuzzer, see #344.
This commit is contained in:
@ -5227,7 +5227,10 @@ htmlCreateMemoryParserCtxt(const char *buffer, int size) {
|
||||
return(NULL);
|
||||
|
||||
buf = xmlParserInputBufferCreateMem(buffer, size, XML_CHAR_ENCODING_NONE);
|
||||
if (buf == NULL) return(NULL);
|
||||
if (buf == NULL) {
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
input = xmlNewInputStream(ctxt);
|
||||
if (input == NULL) {
|
||||
|
Reference in New Issue
Block a user