Handle fatal and FIPS provider interactions

When fatal is called we may be holding memory allocated by OpenSSL.
This may result in the reference count for the FIPS provider not
going to zero and the shared library not being unloaded during
OPENSSL_cleanup.  When the shared library is ultimately unloaded,
when all remaining dynamically loaded libraries are freed, we have
already destroyed the memory context we where using to track memory
leaks / late frees resulting in INSIST being called.

Disable triggering the INSIST when fatal has being called.
This commit is contained in:
Mark Andrews
2023-01-27 16:52:59 +11:00
parent 4e7dadd205
commit e029803704
11 changed files with 31 additions and 2 deletions

View File

@@ -19,6 +19,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <isc/tls.h>
extern bool verbose;
extern const char *progname;
@@ -43,5 +45,6 @@ fatal(const char *format, ...) {
vfprintf(stderr, format, args);
va_end(args);
fprintf(stderr, "\n");
isc__tls_setfatalmode();
exit(1);
}