From 21bf242a31eff79f754c5e9c3b41c52e33483bb0 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 16 Jul 2015 18:28:49 -0700 Subject: Cleanup: Do not check pointers before deleting them, part 2. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1195363002 . --- core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'core/src/fxcodec/jbig2') diff --git a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp index 929180e0b5..622f04b160 100644 --- a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp +++ b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp @@ -3027,9 +3027,7 @@ CJBig2_SymbolDict *CJBig2_SDDProc::decode_Huffman(CJBig2_BitStream *pStream, return pDict; failed: for(I = 0; I < NSYMSDECODED; I++) { - if (SDNEWSYMS[I]) { - delete SDNEWSYMS[I]; - } + delete SDNEWSYMS[I]; } m_pModule->JBig2_Free(SDNEWSYMS); if(SDREFAGG == 0) { @@ -3094,15 +3092,11 @@ CJBig2_Image *CJBig2_HTRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, } } m_pModule->JBig2_Free(GI); - if(HSKIP) { - delete HSKIP; - } + delete HSKIP; delete pGID; return HTREG; failed: - if(HSKIP) { - delete HSKIP; - } + delete HSKIP; delete pGID; delete HTREG; return NULL; -- cgit v1.2.3