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

Unified Diff: fpdfsdk/src/fpdftext.cpp

Issue 1195363002: Cleanup: Do not check pointers before deleting them, part 2. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: nits Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/fpdf_transformpage.cpp ('k') | fpdfsdk/src/javascript/JS_Context.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdftext.cpp
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp
index aba24f4991fcd38aa2c0687203ee7b264b2bdcbd..4a6571531c83272d873fa3990e25e27741beb316 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;
}
« no previous file with comments | « fpdfsdk/src/fpdf_transformpage.cpp ('k') | fpdfsdk/src/javascript/JS_Context.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698