From: Arran Cudbard-Bell Date: Tue, 6 Apr 2021 14:06:50 +0000 (+0100) Subject: Ensure the TLS dictionary is freed on exit X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80a530a6545cfa20df5a7d0514e9ed3ccba2636b;p=thirdparty%2Ffreeradius-server.git Ensure the TLS dictionary is freed on exit --- diff --git a/src/bin/radiusd.c b/src/bin/radiusd.c index b1782002fb..d7bc0f161b 100644 --- a/src/bin/radiusd.c +++ b/src/bin/radiusd.c @@ -1006,6 +1006,13 @@ cleanup: */ if (dl_modules) talloc_free(dl_modules); +#ifdef HAVE_OPENSSL_CRYPTO_H + /* + * Make sure we clean up the TLS dictionary... + */ + fr_tls_dict_free(); +#endif + /* * Cleanup everything else */ diff --git a/src/lib/tls/base-h b/src/lib/tls/base-h index 5aabd45b74..a94de33f86 100644 --- a/src/lib/tls/base-h +++ b/src/lib/tls/base-h @@ -429,6 +429,8 @@ void fr_openssl_free(void); int fr_tls_dict_init(void); +void fr_tls_dict_free(void); + /* * tls/log.c */ diff --git a/src/lib/tls/base.c b/src/lib/tls/base.c index da773a0833..6ef5d2be80 100644 --- a/src/lib/tls/base.c +++ b/src/lib/tls/base.c @@ -481,7 +481,7 @@ void fr_openssl_free(void) TALLOC_FREE(global_mutexes); - fr_dict_autofree(tls_dict); + fr_tls_dict_free(); } #else /** Free any memory alloced by libssl @@ -499,7 +499,7 @@ void fr_openssl_free(void) OPENSSL_cleanup(); - fr_dict_autofree(tls_dict); + fr_tls_dict_free(); } #endif @@ -583,4 +583,8 @@ int fr_tls_dict_init(void) return 0; } +void fr_tls_dict_free(void) +{ + fr_dict_autofree(tls_dict); +} #endif /* WITH_TLS */