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

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

Issue 1297713003: Don't bother checking pointers before delete[] and FX_Free(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: 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
Index: core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
index 78169614bdde09637cf15c5da7810a58559cff93..bd1084339f98a3ab5b2d3b6d1b0809c3c6af0984 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
@@ -439,9 +439,7 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
pDict->RemoveAt(FX_BSTRC("DecodeParms"));
}
} else {
- if (pData) {
FX_Free(pData);
- }
FX_DWORD dwSavePos = m_Pos;
m_Pos += dwStreamSize;
while (1) {
@@ -960,9 +958,8 @@ void CPDF_ContentParser::Clear() {
delete m_pStreamArray[i];
FX_Free(m_pStreamArray);
}
- if (m_pData && m_pSingleStream == NULL) {
+ if (!m_pSingleStream)
FX_Free((void*)m_pData);
Tom Sepez 2015/08/14 21:21:34 nit: void cast not needed?
Lei Zhang 2015/08/14 21:43:15 Done.
- }
m_pParser = NULL;
m_pStreamArray = NULL;
m_pSingleStream = NULL;

Powered by Google App Engine
This is Rietveld 408576698