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_page/fpdf_page_graph_state.cpp | |
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_page/fpdf_page_graph_state.cpp')
-rw-r--r-- | core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp index e010a28b02..f11a2bb8d1 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp @@ -31,14 +31,10 @@ CPDF_ClipPathData::CPDF_ClipPathData() { CPDF_ClipPathData::~CPDF_ClipPathData() { int i; delete[] m_pPathList; - if (m_pTypeList) { - FX_Free(m_pTypeList); - } + FX_Free(m_pTypeList); for (i = m_TextCount - 1; i > -1; i--) delete m_pTextList[i]; - if (m_pTextList) { - FX_Free(m_pTextList); - } + FX_Free(m_pTextList); } CPDF_ClipPathData::CPDF_ClipPathData(const CPDF_ClipPathData& src) { m_pPathList = NULL; @@ -148,9 +144,7 @@ void CPDF_ClipPath::AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge) { delete[] pData->m_pPathList; uint8_t* pNewType = FX_Alloc(uint8_t, pData->m_PathCount + 8); FXSYS_memcpy(pNewType, pData->m_pTypeList, pData->m_PathCount); - if (pData->m_pTypeList) { - FX_Free(pData->m_pTypeList); - } + FX_Free(pData->m_pTypeList); pData->m_pPathList = pNewPath; pData->m_pTypeList = pNewType; } |