From 63d0a52a6af7d327fdb5792f520cc8d93fe2f1bb Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 2 Oct 2015 10:56:30 -0700 Subject: Fix a leak in PDF_DataDecode() on failure. Found using the test examples from https://crbug.com/537780 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1376413003 . --- core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'core') 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; -- cgit v1.2.3