From 7c04794d145d9d5c679dcd33d0ebcef662dcc909 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 14 Feb 2018 16:22:29 +0000 Subject: Set node to owning element When the document creates anew data root element it assigns it into the CXFA_Node but fails to set that node as owing the XML node. The XML node is never inserted into another XML tree so it ends up being leaked. This CL sets the CXFA_Node to own the XML data tree node so it will be cleaned up properly. Bug: chromium:807863 Change-Id: I72a1b8f7b1f1a50bf7139d8bd0ecc8e504ccfc91 Reviewed-on: https://pdfium-review.googlesource.com/26790 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fxfa/parser/xfa_document_datamerger_imp.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'xfa/fxfa/parser') diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp index 8ad38afe2d..56508634c8 100644 --- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp @@ -1411,6 +1411,7 @@ void CXFA_Document::DoDataMerge() { pDataRoot = CreateNode(XFA_PacketType::Datasets, XFA_Element::DataGroup); pDataRoot->JSObject()->SetCData(XFA_Attribute::Name, L"data", false, false); pDataRoot->SetXMLMappingNode(pDataRootXMLNode); + pDataRoot->SetFlag(XFA_NodeFlag_OwnXMLNode); pDatasetsRoot->InsertChild(pDataRoot, nullptr); } -- cgit v1.2.3