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

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

Issue 1192743004: Cleanup: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: 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_func.cpp
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
index 6362be973b7981ed4276b6d4aae79090257a1379..f115b6770de18b236184cf71b98592ab2f536b81 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
@@ -460,9 +460,7 @@ CPDF_SampledFunc::CPDF_SampledFunc()
}
CPDF_SampledFunc::~CPDF_SampledFunc()
{
- if (m_pSampleStream) {
- delete m_pSampleStream;
- }
+ delete m_pSampleStream;
if (m_pEncodeInfo) {
FX_Free(m_pEncodeInfo);
}
@@ -713,9 +711,7 @@ CPDF_StitchFunc::CPDF_StitchFunc()
CPDF_StitchFunc::~CPDF_StitchFunc()
{
for (int i = 0; i < m_nSubs; i ++)
- if (m_pSubFunctions[i]) {
- delete m_pSubFunctions[i];
- }
+ delete m_pSubFunctions[i];
if (m_pSubFunctions) {
FX_Free(m_pSubFunctions);
}

Powered by Google App Engine
This is Rietveld 408576698