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

Unified Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.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 side-by-side diff with in-line comments
Download patch
Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
index 21b2fbae8a99e7d0436da086eae83b784e9c1cdb..1d50346bdb78b66d72f8487caa6484b3eae631c9 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -1732,9 +1732,7 @@ CPDF_SyntaxParser::CPDF_SyntaxParser() {
m_bFileStream = FALSE;
}
CPDF_SyntaxParser::~CPDF_SyntaxParser() {
- if (m_pFileBuf) {
FX_Free(m_pFileBuf);
- }
}
FX_BOOL CPDF_SyntaxParser::GetCharAt(FX_FILESIZE pos, uint8_t& ch) {
FX_FILESIZE save_pos = m_Pos;
@@ -2589,10 +2587,8 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict,
}
void CPDF_SyntaxParser::InitParser(IFX_FileRead* pFileAccess,
FX_DWORD HeaderOffset) {
- if (m_pFileBuf) {
FX_Free(m_pFileBuf);
m_pFileBuf = NULL;
- }
m_pFileBuf = FX_Alloc(uint8_t, m_BufSize);
m_HeaderOffset = HeaderOffset;
m_FileLen = pFileAccess->GetSize();

Powered by Google App Engine
This is Rietveld 408576698