1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-26 00:37:43 +03:00

pattern: Report malloc failures

Fix places where malloc failures aren't reported.

Introduce a new API function xmlPatternCompileSafe that returns a
separate error code if a memory allocation fails.
This commit is contained in:
Nick Wellnhofer
2023-12-10 15:30:47 +01:00
parent a1f7ecaef8
commit e1560990ec
2 changed files with 76 additions and 38 deletions

View File

@@ -54,6 +54,12 @@ XMLPUBFUN xmlPatternPtr
xmlDict *dict,
int flags,
const xmlChar **namespaces);
XMLPUBFUN int
xmlPatternCompileSafe (const xmlChar *pattern,
xmlDict *dict,
int flags,
const xmlChar **namespaces,
xmlPatternPtr *patternOut);
XMLPUBFUN int
xmlPatternMatch (xmlPatternPtr comp,
xmlNodePtr node);