From d2f48e211567454177e8a288782c3598d33995eb Mon Sep 17 00:00:00 2001 From: David Kilzer Date: Wed, 6 Apr 2022 18:05:20 -0700 Subject: Fix leak of xmlElementContent * valid.c: (xmlCopyDocElementContent): - Set `tmp->parent` properly to fix a leak that occurs in xmlFreeDocElementContent(). - Appears to be a regresion from cee2b3a5f1. Found by OSS-Fuzz Issue 44509. --- valid.c | 1 + 1 file changed, 1 insertion(+) diff --git a/valid.c b/valid.c index 9684683a..ed3c8503 100644 --- a/valid.c +++ b/valid.c @@ -1052,6 +1052,7 @@ xmlCopyDocElementContent(xmlDocPtr doc, xmlElementContentPtr cur) { tmp->type = cur->type; tmp->ocur = cur->ocur; prev->c2 = tmp; + tmp->parent = prev; if (cur->name != NULL) { if (dict) tmp->name = xmlDictLookup(dict, cur->name, -1); -- cgit v1.2.1