summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_parser
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdfapi/fpdf_parser')
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp
index 45caf4e9be..6f97c08d2d 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp
@@ -50,10 +50,12 @@ TEST_F(FPDFParserDecodeEmbeddertest, FlateEncode) {
FlateEncodeCase* ptr = &flate_encode_cases[i];
unsigned char* result;
unsigned int result_size;
- FlateEncode(ptr->input, ptr->input_size, result, result_size); // Leaks.
+ FlateEncode(ptr->input, ptr->input_size, result, result_size);
+ ASSERT_TRUE(result);
EXPECT_EQ(std::string((const char*)ptr->expected, ptr->expected_size),
std::string((const char*)result, result_size))
<< " for case " << i;
+ FX_Free(result);
}
}
@@ -87,10 +89,12 @@ TEST_F(FPDFParserDecodeEmbeddertest, FlateDecode) {
FlateDecodeCase* ptr = &flate_decode_cases[i];
unsigned char* result;
unsigned int result_size;
- FlateDecode(ptr->input, ptr->input_size, result, result_size); // Leaks.
+ FlateDecode(ptr->input, ptr->input_size, result, result_size);
+ ASSERT_TRUE(result);
EXPECT_EQ(std::string((const char*)ptr->expected, ptr->expected_size),
std::string((const char*)result, result_size))
<< " for case " << i;
+ FX_Free(result);
}
}