]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove init and deinit from fuzz.h
authorMark Andrews <marka@isc.org>
Wed, 10 May 2023 22:20:54 +0000 (08:20 +1000)
committerMark Andrews <marka@isc.org>
Thu, 18 May 2023 03:45:22 +0000 (13:45 +1000)
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

index 906233335c62c8c9fbb147f46666ac6d3e596547..b5645a99c30eeb0d485ad0721f7cb27d6f8813cb 100644 (file)
@@ -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