Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp

Issue 1297713003: Don't bother checking pointers before delete[] and FX_Free(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
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 e010a28b0205d9bdd17cb6adeae8c93de4831b40..f11a2bb8d1694b9b8d9fc2e817a7937026bafb2d 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;
}
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698