mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-23 01:52:48 +03:00
fixed the leak reported by Volker Roth on the list added a specific test
* parser.c: fixed the leak reported by Volker Roth on the list * test/ent10 result//ent10*: added a specific test for the problem Daniel
This commit is contained in:
8
parser.c
8
parser.c
@@ -5692,16 +5692,20 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
|
||||
xmlAddEntityReference(ent, firstChild, nw);
|
||||
#endif /* LIBXML_LEGACY_ENABLED */
|
||||
} else {
|
||||
const xmlChar *nbktext;
|
||||
|
||||
/*
|
||||
* the name change is to avoid coalescing of the
|
||||
* node with a possible previous text one which
|
||||
* would make ent->children a dangling pointer
|
||||
*/
|
||||
nbktext = xmlDictLookup(ctxt->dict, BAD_CAST "nbktext",
|
||||
-1);
|
||||
if (ent->children->type == XML_TEXT_NODE)
|
||||
ent->children->name = xmlStrdup(BAD_CAST "nbktext");
|
||||
ent->children->name = nbktext;
|
||||
if ((ent->last != ent->children) &&
|
||||
(ent->last->type == XML_TEXT_NODE))
|
||||
ent->last->name = xmlStrdup(BAD_CAST "nbktext");
|
||||
ent->last->name = nbktext;
|
||||
xmlAddChildList(ctxt->node, ent->children);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user