From 104caa3df07909fab4fa001c91c97cf8b80b74ca Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Tue, 13 May 2003 22:54:05 +0000 Subject: [PATCH] oops last commit introduced a memory leak. Daniel * HTMLparser.c: oops last commit introduced a memory leak. Daniel --- ChangeLog | 4 ++++ HTMLparser.c | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3089f26b..2165ac36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue May 13 18:30:34 EDT 2003 Daniel Veillard + + * HTMLparser.c: oops last commit introduced a memory leak. + Tue May 13 18:10:38 EDT 2003 Daniel Veillard * xmllint.c doc/xmllint.xml: added --nonet option diff --git a/HTMLparser.c b/HTMLparser.c index f65084b5..7f3ed471 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -5347,14 +5347,10 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding) { htmlParserCtxtPtr ctxt; htmlParserInputPtr inputStream; - xmlParserInputBufferPtr buf; char *canonicFilename; /* htmlCharEncoding enc; */ xmlChar *content, *content_line = (xmlChar *) "charset="; - buf = xmlParserInputBufferCreateFilename(filename, XML_CHAR_ENCODING_NONE); - if (buf == NULL) return(NULL); - ctxt = (htmlParserCtxtPtr) xmlMalloc(sizeof(htmlParserCtxt)); if (ctxt == NULL) { xmlGenericError(xmlGenericErrorContext, "malloc failed\n"); @@ -5367,6 +5363,7 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding) if (xmlDefaultSAXHandler.error != NULL) { xmlDefaultSAXHandler.error(NULL, "out of memory\n"); } + xmlFreeParserCtxt(ctxt); return(NULL); }