summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-02-14 16:22:29 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-14 16:22:29 +0000
commit7c04794d145d9d5c679dcd33d0ebcef662dcc909 (patch)
tree76a65c6a9331b70c92e6e22f7cc431261c4ec3cc /xfa/fxfa/parser
parent68dde3bce9bb5594b8c1320a0114ebc4be9d3ee7 (diff)
downloadpdfium-7c04794d145d9d5c679dcd33d0ebcef662dcc909.tar.xz
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 <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r--xfa/fxfa/parser/xfa_document_datamerger_imp.cpp1
1 files changed, 1 insertions, 0 deletions
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);
}