summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdftext.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-07-16 18:28:49 -0700
committerLei Zhang <thestig@chromium.org>2015-07-16 18:28:49 -0700
commit21bf242a31eff79f754c5e9c3b41c52e33483bb0 (patch)
tree0eff85fa75ab9091254f7560b37b95408ba8975e /fpdfsdk/src/fpdftext.cpp
parent6915e7bd9e0892f143936697c6ba233510fb13dc (diff)
downloadpdfium-21bf242a31eff79f754c5e9c3b41c52e33483bb0.tar.xz
Cleanup: Do not check pointers before deleting them, part 2.
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1195363002 .
Diffstat (limited to 'fpdfsdk/src/fpdftext.cpp')
-rw-r--r--fpdfsdk/src/fpdftext.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp
index aba24f4991..4a6571531c 100644
--- a/fpdfsdk/src/fpdftext.cpp
+++ b/fpdfsdk/src/fpdftext.cpp
@@ -26,11 +26,7 @@ DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page)
}
DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page)
{
- if (text_page){
- IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
- delete textpage;
- text_page=NULL;
- }
+ delete (IPDF_TextPage*)text_page;
}
DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page)
{
@@ -246,9 +242,6 @@ DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page,int link_index,
}
DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page)
{
- if (!link_page) return;
- IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page;
- delete pageLink;
- pageLink =NULL;
+ delete (IPDF_LinkExtract*)link_page;
}