mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
Martin Stoilov pointed out a potential leak in xmlCreateMemoryParserCtxt
* parser.c: Martin Stoilov pointed out a potential leak in xmlCreateMemoryParserCtxt Daniel
This commit is contained in:
6
parser.c
6
parser.c
@ -10483,10 +10483,14 @@ xmlCreateMemoryParserCtxt(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) {
|
||||
xmlFreeParserInputBuffer(buf);
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
return(NULL);
|
||||
}
|
||||
|
Reference in New Issue
Block a user