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

Unified Diff: xfa/fgas/font/fgas_stdfontmgr.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, 8 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 | « xfa/fee/fde_txtedtpage.cpp ('k') | xfa/fwl/basewidget/fwl_caretimp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fgas/font/fgas_stdfontmgr.cpp
diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp
index 54dd641319708a3d6d05f4eed10d4808258111cb..e840cb2bdd8e911fb2d10860438fcee2d187384a 100644
--- a/xfa/fgas/font/fgas_stdfontmgr.cpp
+++ b/xfa/fgas/font/fgas_stdfontmgr.cpp
@@ -624,18 +624,14 @@ void CFX_FontMgrImp::Release() {
uint32_t dwHash;
CFX_FontDescriptorInfos* pDescs;
m_Hash2CandidateList.GetNextAssoc(pos, dwHash, pDescs);
- if (NULL != pDescs) {
- delete pDescs;
- }
+ delete pDescs;
}
pos = m_Hash2Fonts.GetStartPosition();
while (pos) {
uint32_t dwHash;
CFX_ArrayTemplate<IFX_Font*>* pFonts;
m_Hash2Fonts.GetNextAssoc(pos, dwHash, pFonts);
- if (NULL != pFonts) {
- delete pFonts;
- }
+ delete pFonts;
}
m_Hash2Fonts.RemoveAll();
pos = m_Hash2FileAccess.GetStartPosition();
@@ -1207,9 +1203,7 @@ void CFX_FontMgrImp::ClearFontCache() {
uint32_t dwHash;
CFX_FontDescriptorInfos* pDescs;
m_Hash2CandidateList.GetNextAssoc(pos, dwHash, pDescs);
- if (NULL != pDescs) {
- delete pDescs;
- }
+ delete pDescs;
}
pos = m_FileAccess2IFXFont.GetStartPosition();
while (pos) {
« no previous file with comments | « xfa/fee/fde_txtedtpage.cpp ('k') | xfa/fwl/basewidget/fwl_caretimp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698