From b48704f27fa425d0c4f5b0040cc11e4087c39016 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 14 Apr 2015 16:00:03 -0700 Subject: Land on Master: Fix two new / free mismatches Note: Landed on XFA first by mistake. Original review: https://codereview.chromium.org/1085963002/ TBR=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1090463002 --- core/src/fpdfdoc/doc_metadata.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'core/src/fpdfdoc') diff --git a/core/src/fpdfdoc/doc_metadata.cpp b/core/src/fpdfdoc/doc_metadata.cpp index bf55527d62..232f6eea21 100644 --- a/core/src/fpdfdoc/doc_metadata.cpp +++ b/core/src/fpdfdoc/doc_metadata.cpp @@ -28,7 +28,7 @@ CPDF_Metadata::CPDF_Metadata() { m_pData = FX_Alloc(PDFDOC_METADATA, 1); CFX_CMapByteStringToPtr *&pStringMap = ((PDFDOC_LPMETADATA)m_pData)->m_pStringMap; - pStringMap = FX_NEW(CFX_CMapByteStringToPtr); + pStringMap = FX_NEW CFX_CMapByteStringToPtr; if (pStringMap != NULL) { CFX_ByteString bstr; for (int i = 0; i < 18; i += 2) { @@ -41,13 +41,11 @@ CPDF_Metadata::~CPDF_Metadata() { FXSYS_assert(m_pData != NULL); CXML_Element *&p = ((PDFDOC_LPMETADATA)m_pData)->m_pXmlElmnt; - if (p) { - delete p; - } + delete p; CFX_CMapByteStringToPtr *pStringMap = ((PDFDOC_LPMETADATA)m_pData)->m_pStringMap; if (pStringMap) { pStringMap->RemoveAll(); - FX_Free(pStringMap); + delete pStringMap; } FX_Free(m_pData); } -- cgit v1.2.3