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

Unified Diff: core/src/fxcodec/codec/fx_codec_icc.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/fxcodec/codec/fx_codec_icc.cpp
diff --git a/core/src/fxcodec/codec/fx_codec_icc.cpp b/core/src/fxcodec/codec/fx_codec_icc.cpp
index f33d085f562470d78c202b857e02f47fd058e8d4..e02a528b671026d2ee76a4a050229e2ae750a299 100644
--- a/core/src/fxcodec/codec/fx_codec_icc.cpp
+++ b/core/src/fxcodec/codec/fx_codec_icc.cpp
@@ -514,17 +514,13 @@ CCodec_IccModule::~CCodec_IccModule()
CFX_IccProfileCache* pProfileCache;
while (pos) {
m_MapProfile.GetNextAssoc(pos, key, (void*&)pProfileCache);
- if (pProfileCache) {
- delete pProfileCache;
- }
+ delete pProfileCache;
}
pos = m_MapTranform.GetStartPosition();
CFX_IccTransformCache* pTransformCache;
while (pos) {
m_MapTranform.GetNextAssoc(pos, key, (void*&)pTransformCache);
- if (pTransformCache) {
- delete pTransformCache;
- }
+ delete pTransformCache;
}
}
void* CCodec_IccModule::CreateTransform_sRGB(const uint8_t* pProfileData, FX_DWORD dwProfileSize, int32_t& nComponents, int32_t intent, FX_DWORD dwSrcFormat)

Powered by Google App Engine
This is Rietveld 408576698