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

Side by Side Diff: core/src/fxcodec/jbig2/JBig2_SymbolDict.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "JBig2_SymbolDict.h" 7 #include "JBig2_SymbolDict.h"
8 CJBig2_SymbolDict::CJBig2_SymbolDict() 8 CJBig2_SymbolDict::CJBig2_SymbolDict()
9 { 9 {
10 SDNUMEXSYMS = 0; 10 SDNUMEXSYMS = 0;
(...skipping 23 matching lines...) Expand all
34 dst->SDEXSYMS[i] = NULL; 34 dst->SDEXSYMS[i] = NULL;
35 } 35 }
36 } 36 }
37 return dst; 37 return dst;
38 } 38 }
39 39
40 CJBig2_SymbolDict::~CJBig2_SymbolDict() 40 CJBig2_SymbolDict::~CJBig2_SymbolDict()
41 { 41 {
42 if(SDEXSYMS) { 42 if(SDEXSYMS) {
43 for(FX_DWORD i = 0; i < SDNUMEXSYMS; i++) { 43 for(FX_DWORD i = 0; i < SDNUMEXSYMS; i++) {
44 if(SDEXSYMS[i]) { 44 delete SDEXSYMS[i];
45 delete SDEXSYMS[i];
46 }
47 } 45 }
48 m_pModule->JBig2_Free(SDEXSYMS); 46 m_pModule->JBig2_Free(SDEXSYMS);
49 } 47 }
50 if(m_bContextRetained) { 48 if(m_bContextRetained) {
51 if(m_gbContext) { 49 if(m_gbContext) {
52 m_pModule->JBig2_Free(m_gbContext); 50 m_pModule->JBig2_Free(m_gbContext);
53 } 51 }
54 if(m_grContext) { 52 if(m_grContext) {
55 m_pModule->JBig2_Free(m_grContext); 53 m_pModule->JBig2_Free(m_grContext);
56 } 54 }
57 } 55 }
58 } 56 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698