From e50c962061dd65104e9037b957d9ed01bef8eb9f Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 11 May 2023 08:20:54 +1000 Subject: [PATCH] Remove init and deinit from fuzz.h Constructors and destructors for the main program are not reliable as they may be called before constructors for shared libraries they depend upon or be called after destructors of shared libraries they depend upon. --- fuzz/fuzz.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/fuzz/fuzz.h b/fuzz/fuzz.h index 906233335c..b5645a99c3 100644 --- a/fuzz/fuzz.h +++ b/fuzz/fuzz.h @@ -30,16 +30,4 @@ extern bool debug; int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); -static isc_mem_t *mctx = NULL; - -static void __attribute__((constructor)) init(void) { - isc_mem_create(&mctx); - RUNTIME_CHECK(dst_lib_init(mctx, NULL) == ISC_R_SUCCESS); -} - -static void __attribute__((destructor)) deinit(void) { - dst_lib_destroy(); - isc_mem_destroy(&mctx); -} - ISC_LANG_ENDDECLS