summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-08-11 14:00:22 -0700
committerLei Zhang <thestig@chromium.org>2015-08-11 14:00:22 -0700
commite42e23f34f0a685d6765ba547a26cc2e601efefd (patch)
treeb0f9533e42d1d2383bc3667db84095b53a971ac8 /core/src
parentb4c2167fff88665089eeab47afa45a9e890060a3 (diff)
downloadpdfium-e42e23f34f0a685d6765ba547a26cc2e601efefd.tar.xz
Fix a small leak in CPDF_DataAvail::CheckTrailer().
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1278713003 .
Diffstat (limited to 'core/src')
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
index 23efb52596..21b2fbae8a 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -4104,6 +4104,7 @@ FX_BOOL CPDF_DataAvail::CheckTrailerAppend(IFX_DownloadHints* pHints) {
}
return TRUE;
}
+
FX_BOOL CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints) {
int32_t iTrailerSize =
(int32_t)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512);
@@ -4121,13 +4122,14 @@ FX_BOOL CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints) {
CFX_SmartPointer<IFX_FileStream> file(
FX_CreateMemoryStream(pBuf, (size_t)iSize, FALSE));
m_syntaxParser.InitParser(file.Get(), 0);
- CPDF_Object* pTrailer = m_syntaxParser.GetObject(NULL, 0, 0, 0);
+ CPDF_Object* pTrailer = m_syntaxParser.GetObject(nullptr, 0, 0);
if (!pTrailer) {
m_Pos += m_syntaxParser.SavePos();
pHints->AddSegment(m_Pos, iTrailerSize);
return FALSE;
}
if (pTrailer->GetType() != PDFOBJ_DICTIONARY) {
+ pTrailer->Release();
return FALSE;
}
CPDF_Dictionary* pTrailerDict = pTrailer->GetDict();
@@ -4165,6 +4167,7 @@ FX_BOOL CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints) {
pHints->AddSegment(m_Pos, iTrailerSize);
return FALSE;
}
+
FX_BOOL CPDF_DataAvail::CheckPage(int32_t iPage, IFX_DownloadHints* pHints) {
while (TRUE) {
switch (m_docStatus) {