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

Unified Diff: core/src/fxcodec/codec/fx_codec_jbig.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/fxcodec/codec/fx_codec_jbig.cpp
diff --git a/core/src/fxcodec/codec/fx_codec_jbig.cpp b/core/src/fxcodec/codec/fx_codec_jbig.cpp
index 9d78bba3bb1b3e645978bf790e0d9129efd9de6f..62982436ccb9d400f6a7f816b46617e68dc5447b 100644
--- a/core/src/fxcodec/codec/fx_codec_jbig.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jbig.cpp
@@ -82,9 +82,7 @@ FX_BOOL CCodec_Jbig2Module::Decode(IFX_FileRead* file_ptr,
FX_Free(src_buf);
return TRUE;
failed:
- if (src_buf) {
FX_Free(src_buf);
- }
return FALSE;
}
FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context,
@@ -188,9 +186,7 @@ FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context,
FX_Free(m_pJbig2Context->m_src_buf);
return FXCODEC_STATUS_DECODE_FINISH;
failed:
- if (m_pJbig2Context->m_src_buf) {
FX_Free(m_pJbig2Context->m_src_buf);
- }
m_pJbig2Context->m_src_buf = NULL;
return FXCODEC_STATUS_ERROR;
}
@@ -206,9 +202,7 @@ FXCODEC_STATUS CCodec_Jbig2Module::ContinueDecode(void* pJbig2Context,
CJBig2_Context::DestroyContext(m_pJbig2Context->m_pContext);
m_pJbig2Context->m_pContext = NULL;
if (ret != JBIG2_SUCCESS) {
- if (m_pJbig2Context->m_src_buf) {
FX_Free(m_pJbig2Context->m_src_buf);
- }
m_pJbig2Context->m_src_buf = NULL;
return FXCODEC_STATUS_ERROR;
}

Powered by Google App Engine
This is Rietveld 408576698