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

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: rebase 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
« no previous file with comments | « core/src/fxcodec/codec/fx_codec_icc.cpp ('k') | core/src/fxcodec/codec/fx_codec_jpeg.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1551060b60a12b701572b806c10036989a05a3aa 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);
- }
+ 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);
- }
+ 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);
- }
+ FX_Free(m_pJbig2Context->m_src_buf);
m_pJbig2Context->m_src_buf = NULL;
return FXCODEC_STATUS_ERROR;
}
« no previous file with comments | « core/src/fxcodec/codec/fx_codec_icc.cpp ('k') | core/src/fxcodec/codec/fx_codec_jpeg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698