mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-09-21 09:44:13 +03:00
reader: Don't call xmlCtxtErrMemory with NULL ctxt
This can happen in "walker" mode.
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#endif
|
||||
|
||||
#include "private/buf.h"
|
||||
#include "private/error.h"
|
||||
#include "private/tree.h"
|
||||
#include "private/parser.h"
|
||||
#ifdef LIBXML_XINCLUDE_ENABLED
|
||||
@@ -181,7 +182,10 @@ static void xmlTextReaderFreeNodeList(xmlTextReaderPtr reader, xmlNodePtr cur);
|
||||
|
||||
static void
|
||||
xmlTextReaderErrMemory(xmlTextReaderPtr reader) {
|
||||
if (reader->ctxt != NULL)
|
||||
xmlCtxtErrMemory(reader->ctxt);
|
||||
else
|
||||
xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
|
||||
reader->mode = XML_TEXTREADER_MODE_ERROR;
|
||||
reader->state = XML_TEXTREADER_ERROR;
|
||||
}
|
||||
|
Reference in New Issue
Block a user