Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Unified Diff: testing/test_support.cpp

Issue 1568763003: Fix a GetFileContents() call that should have been in commit aa326bd6. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/test_support.cpp
diff --git a/testing/test_support.cpp b/testing/test_support.cpp
index ce143ae8e9b75153f00c072fde2616eeec296445..96e01c5b01cbf04ba989c83e58a6744a557f02d3 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698