From da180e9fdd4385df024cc18046f62ca47bc74d74 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 14 Aug 2015 22:22:13 -0700 Subject: Merge to XFA: Don't bother checking pointers before delete[] and FX_Free(). R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1297713003 . (cherry picked from commit cb62e7657b3a9a04142028a4e6614029a08e894b) Review URL: https://codereview.chromium.org/1287053005 . --- core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp | 34 ++++++--------------------- 1 file changed, 7 insertions(+), 27 deletions(-) (limited to 'core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp') diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp index 1ee062ee7c..8c909a9e68 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp @@ -487,12 +487,8 @@ CPDF_SampledFunc::CPDF_SampledFunc() { } CPDF_SampledFunc::~CPDF_SampledFunc() { delete m_pSampleStream; - if (m_pEncodeInfo) { - FX_Free(m_pEncodeInfo); - } - if (m_pDecodeInfo) { - FX_Free(m_pDecodeInfo); - } + FX_Free(m_pEncodeInfo); + FX_Free(m_pDecodeInfo); } FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj) { if (pObj->GetType() != PDFOBJ_STREAM) { @@ -678,12 +674,8 @@ CPDF_ExpIntFunc::CPDF_ExpIntFunc() { m_pEndValues = NULL; } CPDF_ExpIntFunc::~CPDF_ExpIntFunc() { - if (m_pBeginValues) { FX_Free(m_pBeginValues); - } - if (m_pEndValues) { FX_Free(m_pEndValues); - } } FX_BOOL CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj) { CPDF_Dictionary* pDict = pObj->GetDict(); @@ -747,15 +739,9 @@ CPDF_StitchFunc::CPDF_StitchFunc() { CPDF_StitchFunc::~CPDF_StitchFunc() { for (int i = 0; i < m_nSubs; i++) delete m_pSubFunctions[i]; - if (m_pSubFunctions) { - FX_Free(m_pSubFunctions); - } - if (m_pBounds) { - FX_Free(m_pBounds); - } - if (m_pEncode) { - FX_Free(m_pEncode); - } + FX_Free(m_pSubFunctions); + FX_Free(m_pBounds); + FX_Free(m_pEncode); } FX_BOOL CPDF_StitchFunc::v_Init(CPDF_Object* pObj) { CPDF_Dictionary* pDict = pObj->GetDict(); @@ -859,14 +845,8 @@ CPDF_Function::CPDF_Function() { m_pRanges = NULL; } CPDF_Function::~CPDF_Function() { - if (m_pDomains) { - FX_Free(m_pDomains); - m_pDomains = NULL; - } - if (m_pRanges) { - FX_Free(m_pRanges); - m_pRanges = NULL; - } + FX_Free(m_pDomains); + FX_Free(m_pRanges); } FX_BOOL CPDF_Function::Init(CPDF_Object* pObj) { CPDF_Dictionary* pDict; -- cgit v1.2.3