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:
26
parser.c
26
parser.c
@ -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
|
||||
|
Reference in New Issue
Block a user