diff options
author | Lei Zhang <thestig@chromium.org> | 2015-08-14 15:45:39 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-08-14 15:45:39 -0700 |
commit | cb62e7657b3a9a04142028a4e6614029a08e894b (patch) | |
tree | e7fa5f4c7d7f12bff9315475a89872fb044c36b1 /core/src/fxcodec/codec/fx_codec_jbig.cpp | |
parent | 0f6b51c0fdd14f5762bf3c7412ac59c825443cc3 (diff) | |
download | pdfium-cb62e7657b3a9a04142028a4e6614029a08e894b.tar.xz |
Don't bother checking pointers before delete[] and FX_Free().
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1297713003 .
Diffstat (limited to 'core/src/fxcodec/codec/fx_codec_jbig.cpp')
-rw-r--r-- | core/src/fxcodec/codec/fx_codec_jbig.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/core/src/fxcodec/codec/fx_codec_jbig.cpp b/core/src/fxcodec/codec/fx_codec_jbig.cpp index 9d78bba3bb..1551060b60 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; } |