summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_parser
diff options
context:
space:
mode:
authorQin Zhao <zhaoqin@google.com>2015-11-25 10:52:35 -0500
committerQin Zhao <zhaoqin@google.com>2015-11-25 10:52:35 -0500
commitc998e22d3bb0c9ce035aea2e9fe9e39a3f14fe3c (patch)
tree4a45262b09eceb35968d6e69b59ed16b861c9e6f /core/src/fpdfapi/fpdf_parser
parentab777e40b58c68e4e9203a2241c059ce50d797fd (diff)
downloadpdfium-c998e22d3bb0c9ce035aea2e9fe9e39a3f14fe3c.tar.xz
Merge to XFA: Fix two memory leaks from pdfium_unittests
- remove redundant alloc in fx_codec_jpx_unittest.cpp - free memory allocated by HexDecode calls in fpdf_parser_decode_unittest.cpp BUG=PDFium:239 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1467183006 . (cherry picked from commit 6c2d736011c09266015d3e2a0b9c08aeba1bbf31) Review URL: https://codereview.chromium.org/1477833002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_parser')
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_unittest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_unittest.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_unittest.cpp
index 95d7c84ace..3318bcdfe7 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_unittest.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_unittest.cpp
@@ -14,6 +14,7 @@ TEST(fpdf_parser_decode, HexDecode) {
EXPECT_EQ(0, HexDecode(src, 0, dest, dest_size));
EXPECT_EQ(0, dest_size);
EXPECT_EQ('\0', dest[0]);
+ FX_Free(dest);
}
{
@@ -25,6 +26,7 @@ TEST(fpdf_parser_decode, HexDecode) {
EXPECT_EQ(2, dest_size);
EXPECT_EQ(18, dest[0]);
EXPECT_EQ(172, dest[1]);
+ FX_Free(dest);
}
{
@@ -36,6 +38,7 @@ TEST(fpdf_parser_decode, HexDecode) {
EXPECT_EQ(2, dest_size);
EXPECT_EQ(18, dest[0]);
EXPECT_EQ(160, dest[1]);
+ FX_Free(dest);
}
{
@@ -47,5 +50,6 @@ TEST(fpdf_parser_decode, HexDecode) {
EXPECT_EQ(2, dest_size);
EXPECT_EQ(18, dest[0]);
EXPECT_EQ(172, dest[1]);
+ FX_Free(dest);
}
}