mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-26 00:37:43 +03:00
valid: Improve addition and deletion of IDs
Introduce a new API function xmlAddIDSafe that returns a separate error code if a memory allocation fails. Store a pointer to the ID struct in xmlAttr so attributes can be freed without allocating memory. It's impossible to report malloc failures in deallocation code.
This commit is contained in:
@@ -249,6 +249,12 @@ XMLPUBFUN void
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
|
||||
/* IDs */
|
||||
XMLPUBFUN int
|
||||
xmlAddIDSafe (xmlDocPtr doc,
|
||||
const xmlChar *value,
|
||||
xmlAttrPtr attr,
|
||||
int streaming,
|
||||
xmlIDPtr *id);
|
||||
XMLPUBFUN xmlIDPtr
|
||||
xmlAddID (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
|
||||
Reference in New Issue
Block a user