Cleanup at pdf fuzzer termination.
It seems the fuzzer infrastructure is more particular about
leaks. Use the simplest possible pattern (static destruction) to
verify this resolves the issue.
Bug: chromium:1451173
Change-Id: If13e10dd44304156183267df5ffaa5f35171b87a
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/108610
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/testing/fuzzers/pdf_fuzzer_init_public.cc b/testing/fuzzers/pdf_fuzzer_init_public.cc
index 3227d47..993c8a7 100644
--- a/testing/fuzzers/pdf_fuzzer_init_public.cc
+++ b/testing/fuzzers/pdf_fuzzer_init_public.cc
@@ -36,8 +36,9 @@
namespace {
// pdf_fuzzer_init.cc and pdf_fuzzer_init_public.cc are mutually exclusive
-// and should not be built together.
-PDFFuzzerInitPublic* g_instance = new PDFFuzzerInitPublic();
+// and should not be built together. Static initializers and destructors
+// avoid problems with fuzzer initialization and termination.
+PDFFuzzerInitPublic g_instance;
#ifdef PDF_ENABLE_V8
std::string ProgramPath() {