mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-21 14:53:44 +03:00
parser: Remove unnecessary dict checks when freeing strings
The following strings are never allocated from a dict: - xmlParserCtxt.version - xmlParserCtxt.encoding - xmlParserCtxt.extSubURI - xmlParserCtxt.extSubSystem - xmlDoc.version - xmlDoc.encoding - xmlDoc.URL - xmlDTD.ExternalID - xmlDTD.SystemID - xmlID.value Also make the struct members point to non-const chars to avoid casts when freeing.
This commit is contained in:
10
HTMLparser.c
10
HTMLparser.c
@@ -5483,16 +5483,6 @@ htmlNodeStatus(xmlNode *node ATTRIBUTE_UNUSED,
|
||||
* New set (2.6.0) of simpler and more flexible APIs *
|
||||
* *
|
||||
************************************************************************/
|
||||
/**
|
||||
* Free a string if it is not owned by the "dict" dictionary in the
|
||||
* current scope
|
||||
*
|
||||
* @param str a string
|
||||
*/
|
||||
#define DICT_FREE(str) \
|
||||
if ((str) && ((!dict) || \
|
||||
(xmlDictOwns(dict, (const xmlChar *)(str)) == 0))) \
|
||||
xmlFree((char *)(str));
|
||||
|
||||
/**
|
||||
* Reset a parser context
|
||||
|
Reference in New Issue
Block a user