summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_parser
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-02 11:18:01 -0700
committerLei Zhang <thestig@chromium.org>2015-10-02 11:18:01 -0700
commitc955a2aa76e6fb681f84177942df1b305430c471 (patch)
tree2dc861b3b2052726f803aef0e07a5e15b3b813f0 /core/src/fpdfapi/fpdf_parser
parent9dd3dc19a1ddb6c0a6fc61ee185363591a571b98 (diff)
downloadpdfium-c955a2aa76e6fb681f84177942df1b305430c471.tar.xz
Merge to XFA: Fix a leak in PDF_DataDecode() on failure.
Found using the test examples from https://crbug.com/537780 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1376413003 . (cherry picked from commit 63d0a52a6af7d327fdb5792f520cc8d93fe2f1bb) Review URL: https://codereview.chromium.org/1378303006 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_parser')
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
index 402a19ed4a..2d6e9f3436 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
@@ -416,6 +416,7 @@ FX_BOOL PDF_DataDecode(const uint8_t* src_buf,
FX_Free(last_buf);
}
if (offset == -1) {
+ FX_Free(new_buf);
return FALSE;
}
last_buf = new_buf;