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

Side by Side Diff: xfa/fxfa/parser/xfa_script_resolveprocessor.cpp

Issue 1925363002: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 7 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
« no previous file with comments | « xfa/fxfa/parser/xfa_script_imp.cpp ('k') | xfa/fxgraphics/cagg_graphics.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "xfa/fxfa/parser/xfa_script_resolveprocessor.h" 7 #include "xfa/fxfa/parser/xfa_script_resolveprocessor.h"
8 8
9 #include "core/fxcrt/include/fx_ext.h" 9 #include "core/fxcrt/include/fx_ext.h"
10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" 10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h"
11 #include "xfa/fxfa/parser/xfa_doclayout.h" 11 #include "xfa/fxfa/parser/xfa_doclayout.h"
12 #include "xfa/fxfa/parser/xfa_document.h" 12 #include "xfa/fxfa/parser/xfa_document.h"
13 #include "xfa/fxfa/parser/xfa_localemgr.h" 13 #include "xfa/fxfa/parser/xfa_localemgr.h"
14 #include "xfa/fxfa/parser/xfa_object.h" 14 #include "xfa/fxfa/parser/xfa_object.h"
15 #include "xfa/fxfa/parser/xfa_parser.h" 15 #include "xfa/fxfa/parser/xfa_parser.h"
16 #include "xfa/fxfa/parser/xfa_script.h" 16 #include "xfa/fxfa/parser/xfa_script.h"
17 #include "xfa/fxfa/parser/xfa_script_imp.h" 17 #include "xfa/fxfa/parser/xfa_script_imp.h"
18 #include "xfa/fxfa/parser/xfa_script_nodehelper.h" 18 #include "xfa/fxfa/parser/xfa_script_nodehelper.h"
19 #include "xfa/fxfa/parser/xfa_utils.h" 19 #include "xfa/fxfa/parser/xfa_utils.h"
20 20
21 CXFA_ResolveProcessor::CXFA_ResolveProcessor(void) 21 CXFA_ResolveProcessor::CXFA_ResolveProcessor(void)
22 : m_pNodeHelper(NULL), m_iCurStart(0) { 22 : m_pNodeHelper(new CXFA_NodeHelper), m_iCurStart(0) {}
23 m_pNodeHelper = new CXFA_NodeHelper; 23
24 CXFA_ResolveProcessor::~CXFA_ResolveProcessor(void) {
25 delete m_pNodeHelper;
24 } 26 }
25 CXFA_ResolveProcessor::~CXFA_ResolveProcessor(void) { 27
26 if (m_pNodeHelper) {
27 delete m_pNodeHelper;
28 m_pNodeHelper = NULL;
29 }
30 }
31 int32_t CXFA_ResolveProcessor::XFA_ResolveNodes(CXFA_ResolveNodesData& rnd) { 28 int32_t CXFA_ResolveProcessor::XFA_ResolveNodes(CXFA_ResolveNodesData& rnd) {
32 if (rnd.m_CurNode == NULL) { 29 if (rnd.m_CurNode == NULL) {
33 return -1; 30 return -1;
34 } 31 }
35 if (!rnd.m_CurNode->IsNode()) { 32 if (!rnd.m_CurNode->IsNode()) {
36 if (rnd.m_dwStyles & XFA_RESOLVENODE_Attributes) { 33 if (rnd.m_dwStyles & XFA_RESOLVENODE_Attributes) {
37 return XFA_ResolveNodes_ForAttributeRs(rnd.m_CurNode, rnd, 34 return XFA_ResolveNodes_ForAttributeRs(rnd.m_CurNode, rnd,
38 rnd.m_wsName.AsStringC()); 35 rnd.m_wsName.AsStringC());
39 } 36 }
40 return 0; 37 return 0;
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 if (m_pNodeHelper->XFA_CreateNode_ForCondition(wsNextCondition)) { 814 if (m_pNodeHelper->XFA_CreateNode_ForCondition(wsNextCondition)) {
818 if (m_pNodeHelper->m_eLastCreateType == XFA_ELEMENT_DataGroup) { 815 if (m_pNodeHelper->m_eLastCreateType == XFA_ELEMENT_DataGroup) {
819 iIndex = 0; 816 iIndex = 0;
820 } else { 817 } else {
821 iIndex = iCount - 1; 818 iIndex = iCount - 1;
822 } 819 }
823 } else { 820 } else {
824 iIndex = iCount - 1; 821 iIndex = iCount - 1;
825 } 822 }
826 } 823 }
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/xfa_script_imp.cpp ('k') | xfa/fxgraphics/cagg_graphics.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698