summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc/doc_metadata.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-14 15:55:35 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-14 15:55:35 -0700
commit35d0c9a7a442cf1305913fb2de2c6f99842ea586 (patch)
tree8aaa4fb942e7b4097bfd3e4fd12414d2781ee4d2 /core/src/fpdfdoc/doc_metadata.cpp
parent3da4f9e6bffdf9e5ae4295806446cb69e363eb9c (diff)
downloadpdfium-35d0c9a7a442cf1305913fb2de2c6f99842ea586.tar.xz
Fix two new / free mismatches
R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1085963002
Diffstat (limited to 'core/src/fpdfdoc/doc_metadata.cpp')
-rw-r--r--core/src/fpdfdoc/doc_metadata.cpp8
1 files changed, 3 insertions, 5 deletions
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);
}