summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-01-06 10:16:32 -0800
committerTom Sepez <tsepez@chromium.org>2016-01-06 10:16:32 -0800
commit0aa3531a87dde44ffd90416f6d621b1828edaf22 (patch)
tree9b5f0e12a5e1aec13fd3d4f0242efcc6834d830e /samples
parentd483eb46d8920547d1b47351e65fa0299eaba191 (diff)
downloadpdfium-0aa3531a87dde44ffd90416f6d621b1828edaf22.tar.xz
Merge to XFA: Return unique_ptrs from test_support functions
Orignal Review URL: https://codereview.chromium.org/1563513002 . (cherry picked from commit aa326bd6b169dc1b5b9b83048c71799799ab34c6) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1564583004 .
Diffstat (limited to 'samples')
-rw-r--r--samples/pdfium_test.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index 6bf1ec18ce..dbd91c31da 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -611,11 +611,10 @@ int main(int argc, const char* argv[]) {
std::string filename = files.front();
files.pop_front();
size_t file_length = 0;
- char* file_contents = GetFileContents(filename.c_str(), &file_length);
- if (!file_contents)
- continue;
- RenderPdf(filename, file_contents, file_length, options);
- free(file_contents);
+ std::unique_ptr<char, pdfium::FreeDeleter> file_contents =
+ GetFileContents(filename.c_str(), &file_length);
+ if (file_contents)
+ RenderPdf(filename, file_contents.get(), file_length, options);
}
FPDF_DestroyLibrary();