diff options
author | Lei Zhang <thestig@chromium.org> | 2015-08-14 22:22:13 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-08-14 22:22:13 -0700 |
commit | da180e9fdd4385df024cc18046f62ca47bc74d74 (patch) | |
tree | 931e0e64ac2cbc82e3718e43418ee6bd676da4a5 /core/src/fpdfapi/fpdf_render | |
parent | 2b1a2d528469cda4e9f3e36d3c7a649e0d476480 (diff) | |
download | pdfium-da180e9fdd4385df024cc18046f62ca47bc74d74.tar.xz |
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 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp | 12 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp | 4 |
2 files changed, 4 insertions, 12 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp index e066957e62..8a614810df 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp @@ -182,17 +182,11 @@ CPDF_DIBSource::CPDF_DIBSource() { } CPDF_DIBSource::~CPDF_DIBSource() { delete m_pStreamAcc; - if (m_pMaskedLine) { - FX_Free(m_pMaskedLine); - } - if (m_pLineBuf) { - FX_Free(m_pLineBuf); - } + FX_Free(m_pMaskedLine); + FX_Free(m_pLineBuf); m_pCachedBitmap.reset(); delete m_pDecoder; - if (m_pCompData) { - FX_Free(m_pCompData); - } + FX_Free(m_pCompData); CPDF_ColorSpace* pCS = m_pColorSpace; if (pCS && m_pDocument) { m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray()); diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp index 7d6921f544..d36125e1b8 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp @@ -531,9 +531,7 @@ CPDF_CharPosList::CPDF_CharPosList() { m_pCharPos = NULL; } CPDF_CharPosList::~CPDF_CharPosList() { - if (m_pCharPos) { - FX_Free(m_pCharPos); - } + FX_Free(m_pCharPos); } void CPDF_CharPosList::Load(int nChars, FX_DWORD* pCharCodes, |