summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-01-07 00:48:00 -0800
committerLei Zhang <thestig@chromium.org>2016-01-07 00:48:00 -0800
commitbcc03a4d8340d06c013a8e7bc5f11be4e820bb41 (patch)
treee5f218a94befe7198315fccf14f6dc643e74397d /testing
parent3115624972b15136e2b01da4929af4071d4d0bda (diff)
downloadpdfium-bcc03a4d8340d06c013a8e7bc5f11be4e820bb41.tar.xz
Merge to XFA: Fix a GetFileContents() call that should have been in commit aa326bd6.
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1568763003 . (cherry picked from commit 0213958bf66e839f132d9dea531d2627091c3cbe) Review URL: https://codereview.chromium.org/1565783004 .
Diffstat (limited to 'testing')
-rw-r--r--testing/test_support.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/testing/test_support.cpp b/testing/test_support.cpp
index ce143ae8e9..96e01c5b01 100644
--- a/testing/test_support.cpp
+++ b/testing/test_support.cpp
@@ -45,11 +45,12 @@ bool GetExternalData(const std::string& exe_path,
std::string full_path =
GetFullPathForSnapshotFile(exe_path, bin_dir, filename);
size_t data_length = 0;
- char* data_buffer = GetFileContents(full_path.c_str(), &data_length);
- if (!data_buffer) {
+ std::unique_ptr<char, pdfium::FreeDeleter> data_buffer =
+ GetFileContents(full_path.c_str(), &data_length);
+ if (!data_buffer)
return false;
- }
- result_data->data = const_cast<const char*>(data_buffer);
+
+ result_data->data = data_buffer.release();
result_data->raw_size = data_length;
return true;
}