summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorQin Zhao <zhaoqin@google.com>2015-10-20 18:31:06 -0400
committerQin Zhao <zhaoqin@google.com>2015-10-20 18:31:06 -0400
commit0522497f8926993166d5d2ffea256083a9a8dc11 (patch)
tree037272a63b66de500d4b39bfd437088e7eee19e9 /samples
parentb95fc6d9f2f591ba26da38d97adf840762ce049e (diff)
downloadpdfium-0522497f8926993166d5d2ffea256083a9a8dc11.tar.xz
Fix pdfium-i#236: memory leaks from RenderPdf
- add FPDFAvail_Destroy(pdf_avail) on the early return path in RenderPdf TBR=thestig@chromium.org BUG=pdfium:236 Review URL: https://codereview.chromium.org/1410333007 . (cherry picked from commit 0223be82e0afcfee7c501ad2754230353bff79ff) Review URL: https://codereview.chromium.org/1414913003 .
Diffstat (limited to 'samples')
-rw-r--r--samples/pdfium_test.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index 19b6b4642e..c9d84af04d 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -390,6 +390,7 @@ void RenderPdf(const std::string& name, const char* pBuf, size_t len,
if (!doc) {
fprintf(stderr, "Load pdf docs unsuccessful.\n");
+ FPDFAvail_Destroy(pdf_avail);
return;
}