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

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

Issue 1192743004: Cleanup: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 6 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
Index: core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index 5f4023a278eab09ea1ade1db55ee6fa0e2b147af..fdc4a279897b7fc6d89323a78764330a66fa9233 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -44,9 +44,7 @@ CPDF_StreamContentParser::~CPDF_StreamContentParser()
if (m_pPathPoints) {
FX_Free(m_pPathPoints);
}
- if (m_pCurStates) {
- delete m_pCurStates;
- }
+ delete m_pCurStates;
if (m_pLastImageDict) {
m_pLastImageDict->Release();
}
@@ -801,9 +799,7 @@ void CPDF_StreamContentParser::Handle_EndText()
if (m_pCurStates->m_TextState.GetObject()->m_TextMode < 4) {
for (int i = 0; i < count; i ++) {
CPDF_TextObject* pText = (CPDF_TextObject*)m_ClipTextList.GetAt(i);
- if (pText) {
- delete pText;
- }
+ delete pText;
}
} else {
m_pCurStates->m_ClipPath.AppendTexts((CPDF_TextObject**)m_ClipTextList.GetData(), count);
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698