1
0
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:
Nick Wellnhofer
2023-12-10 16:29:31 +01:00
parent e1560990ec
commit e34a49b78e
3 changed files with 117 additions and 78 deletions

View File

@@ -440,6 +440,7 @@ struct _xmlAttr {
xmlNs *ns; /* pointer to the associated namespace */
xmlAttributeType atype; /* the attribute type if validating */
void *psvi; /* for type/PSVI information */
struct _xmlID *id; /* the ID struct */
};
/**