mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
parser: Don't report malloc failures when creating context
We don't want messages to stderr before an error handler could be set on a parser context.
This commit is contained in:
@@ -5817,13 +5817,17 @@ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data,
|
||||
return(NULL);
|
||||
|
||||
encoding = xmlGetCharEncodingName(enc);
|
||||
input = xmlNewInputPush(ctxt, filename, chunk, size, encoding);
|
||||
input = xmlInputCreatePush(filename, chunk, size);
|
||||
if (input == NULL) {
|
||||
htmlFreeParserCtxt(ctxt);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
inputPush(ctxt, input);
|
||||
|
||||
if (encoding != NULL)
|
||||
xmlSwitchEncodingName(ctxt, encoding);
|
||||
|
||||
return(ctxt);
|
||||
}
|
||||
#endif /* LIBXML_PUSH_ENABLED */
|
||||
|
||||
Reference in New Issue
Block a user