mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-21 14:53:44 +03:00
many further little changes for OOM problems. Now seems to be getting
* SAX2.c, encoding.c, error.c, parser.c, tree.c, uri.c, xmlIO.c, xmlreader.c, include/libxml/tree.h: many further little changes for OOM problems. Now seems to be getting closer to "ok". * testOOM.c: added code to intercept more errors, found more problems with library. Changed method of flagging / counting errors intercepted.
This commit is contained in:
@@ -1878,6 +1878,12 @@ xmlNewTextReader(xmlParserInputBufferPtr input, const char *URI) {
|
||||
ret->entNr = 0;
|
||||
ret->input = input;
|
||||
ret->buffer = xmlBufferCreateSize(100);
|
||||
if (ret->buffer == NULL) {
|
||||
xmlFree(ret);
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"xmlNewTextReader : malloc failed\n");
|
||||
return(NULL);
|
||||
}
|
||||
ret->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
|
||||
if (ret->sax == NULL) {
|
||||
xmlBufferFree(ret->buffer);
|
||||
@@ -3908,7 +3914,8 @@ xmlTextReaderGenericError(void *ctxt, xmlParserSeverities severity, char *str) {
|
||||
xmlParserCtxtPtr ctx = (xmlParserCtxtPtr)ctxt;
|
||||
xmlTextReaderPtr reader = (xmlTextReaderPtr)ctx->_private;
|
||||
|
||||
if (str != NULL && reader->errorFunc) {
|
||||
if (str != NULL) {
|
||||
if (reader->errorFunc)
|
||||
reader->errorFunc(reader->errorFuncArg,
|
||||
str,
|
||||
severity,
|
||||
|
Reference in New Issue
Block a user