mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
oops last commit introduced a memory leak. Daniel
* HTMLparser.c: oops last commit introduced a memory leak. Daniel
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
Tue May 13 18:30:34 EDT 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* HTMLparser.c: oops last commit introduced a memory leak.
|
||||||
|
|
||||||
Tue May 13 18:10:38 EDT 2003 Daniel Veillard <daniel@veillard.com>
|
Tue May 13 18:10:38 EDT 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* xmllint.c doc/xmllint.xml: added --nonet option
|
* xmllint.c doc/xmllint.xml: added --nonet option
|
||||||
|
@ -5347,14 +5347,10 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding)
|
|||||||
{
|
{
|
||||||
htmlParserCtxtPtr ctxt;
|
htmlParserCtxtPtr ctxt;
|
||||||
htmlParserInputPtr inputStream;
|
htmlParserInputPtr inputStream;
|
||||||
xmlParserInputBufferPtr buf;
|
|
||||||
char *canonicFilename;
|
char *canonicFilename;
|
||||||
/* htmlCharEncoding enc; */
|
/* htmlCharEncoding enc; */
|
||||||
xmlChar *content, *content_line = (xmlChar *) "charset=";
|
xmlChar *content, *content_line = (xmlChar *) "charset=";
|
||||||
|
|
||||||
buf = xmlParserInputBufferCreateFilename(filename, XML_CHAR_ENCODING_NONE);
|
|
||||||
if (buf == NULL) return(NULL);
|
|
||||||
|
|
||||||
ctxt = (htmlParserCtxtPtr) xmlMalloc(sizeof(htmlParserCtxt));
|
ctxt = (htmlParserCtxtPtr) xmlMalloc(sizeof(htmlParserCtxt));
|
||||||
if (ctxt == NULL) {
|
if (ctxt == NULL) {
|
||||||
xmlGenericError(xmlGenericErrorContext, "malloc failed\n");
|
xmlGenericError(xmlGenericErrorContext, "malloc failed\n");
|
||||||
@ -5367,6 +5363,7 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding)
|
|||||||
if (xmlDefaultSAXHandler.error != NULL) {
|
if (xmlDefaultSAXHandler.error != NULL) {
|
||||||
xmlDefaultSAXHandler.error(NULL, "out of memory\n");
|
xmlDefaultSAXHandler.error(NULL, "out of memory\n");
|
||||||
}
|
}
|
||||||
|
xmlFreeParserCtxt(ctxt);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user