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

Side by Side Diff: fpdfsdk/src/fsdk_actionhandler.cpp

Issue 1297713003: Don't bother checking pointers before delete[] and FX_Free(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: 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 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 "../include/fsdk_define.h" 7 #include "../include/fsdk_define.h"
8 #include "../include/fsdk_mgr.h" 8 #include "../include/fsdk_mgr.h"
9 #include "../include/fsdk_actionhandler.h" 9 #include "../include/fsdk_actionhandler.h"
10 #include "../include/javascript/IJavaScript.h" 10 #include "../include/javascript/IJavaScript.h"
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 int sizeOfAry = 0; 527 int sizeOfAry = 0;
528 if (pMyArray != NULL) { 528 if (pMyArray != NULL) {
529 pPosAry = new float[pMyArray->GetCount()]; 529 pPosAry = new float[pMyArray->GetCount()];
530 int j = 0; 530 int j = 0;
531 for (int i = 2; i < (int)pMyArray->GetCount(); i++) { 531 for (int i = 2; i < (int)pMyArray->GetCount(); i++) {
532 pPosAry[j++] = pMyArray->GetFloat(i); 532 pPosAry[j++] = pMyArray->GetFloat(i);
533 } 533 }
534 sizeOfAry = j; 534 sizeOfAry = j;
535 } 535 }
536 pApp->FFI_DoGoToAction(nPageIndex, nFitType, pPosAry, sizeOfAry); 536 pApp->FFI_DoGoToAction(nPageIndex, nFitType, pPosAry, sizeOfAry);
537 if (pPosAry) 537 delete[] pPosAry;
538 delete[] pPosAry;
539 } 538 }
540 539
541 void CPDFSDK_ActionHandler::DoAction_GoToR(CPDFSDK_Document* pDocument, 540 void CPDFSDK_ActionHandler::DoAction_GoToR(CPDFSDK_Document* pDocument,
542 const CPDF_Action& action) {} 541 const CPDF_Action& action) {}
543 542
544 void CPDFSDK_ActionHandler::DoAction_Launch(CPDFSDK_Document* pDocument, 543 void CPDFSDK_ActionHandler::DoAction_Launch(CPDFSDK_Document* pDocument,
545 const CPDF_Action& action) {} 544 const CPDF_Action& action) {}
546 545
547 void CPDFSDK_ActionHandler::DoAction_URI(CPDFSDK_Document* pDocument, 546 void CPDFSDK_ActionHandler::DoAction_URI(CPDFSDK_Document* pDocument,
548 const CPDF_Action& action) { 547 const CPDF_Action& action) {
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 const CPDF_Action& action, 777 const CPDF_Action& action,
779 CPDFSDK_Document* pDocument) { 778 CPDFSDK_Document* pDocument) {
780 return FALSE; 779 return FALSE;
781 } 780 }
782 781
783 FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Movie( 782 FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Movie(
784 const CPDF_Action& action, 783 const CPDF_Action& action,
785 CPDFSDK_Document* pDocument) { 784 CPDFSDK_Document* pDocument) {
786 return FALSE; 785 return FALSE;
787 } 786 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698