1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

more cleanup of error handling in parserInternals, sharing the routine for

* parserInternals.c parser.c valid.c include/libxml/parserInternals.h:
  more cleanup of error handling in parserInternals, sharing the
  routine for memory errors.
Daniel
This commit is contained in:
Daniel Veillard
2003-10-05 21:33:18 +00:00
parent f403d298c3
commit ce9457f3aa
5 changed files with 248 additions and 218 deletions

View File

@ -128,32 +128,6 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt,
* *
************************************************************************/
/**
* xmlErrMemory:
* @ctxt: an XML parser context
* @extra: extra informations
*
* Handle a redefinition of attribute error
*/
static void
xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra)
{
if (ctxt != NULL) {
ctxt->errNo = XML_ERR_NO_MEMORY;
ctxt->instate = XML_PARSER_EOF;
ctxt->disableSAX = 1;
}
if (extra)
__xmlRaiseError(NULL, NULL, ctxt, NULL, XML_FROM_PARSER,
XML_ERR_NO_MEMORY, XML_ERR_FATAL, NULL, 0, extra,
NULL, NULL, 0, 0,
"Memory allocation failed : %s\n", extra);
else
__xmlRaiseError(NULL, NULL, ctxt, NULL, XML_FROM_PARSER,
XML_ERR_NO_MEMORY, XML_ERR_FATAL, NULL, 0, NULL,
NULL, NULL, 0, 0, "Memory allocation failed\n");
}
/**
* xmlErrAttributeDup:
* @ctxt: an XML parser context