diff --git a/ChangeLog b/ChangeLog index 5fa8cec3..6af9054c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Nov 19 09:09:04 CET 2002 Daniel Veillard + + * parser.c: Martin Stoilov pointed out a potential leak in + xmlCreateMemoryParserCtxt + Mon Nov 18 16:05:51 CET 2002 Daniel Veillard * HTMLparser.c: fixed bug #98879 a corner case when 0 is diff --git a/parser.c b/parser.c index 3b62431a..41e4caf1 100644 --- a/parser.c +++ b/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); }