]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Revert "ITS#9952 libldap: use atexit for TLS teardown"
authorHoward Chu <hyc@openldap.org>
Tue, 13 Feb 2024 17:29:05 +0000 (17:29 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 13 Feb 2024 17:29:05 +0000 (17:29 +0000)
This reverts commit 337455eb3a66176cc3f66d2c663a72cc7b4178bd.
The change was non-portable, caused ITS#10176. OpenSSL 3 is
broken and should be fixed.

libraries/libldap/init.c
libraries/libldap/tls2.c

index b9915533bd92129af5c9a5bd787a4a47fe1ecbeb..3a81790dcf86b0005ef1f6a087e102bf8dd79a7d 100644 (file)
@@ -544,6 +544,9 @@ ldap_int_destroy_global_options(void)
                gopts->ldo_def_sasl_authcid = NULL;
        }
 #endif
+#ifdef HAVE_TLS
+       ldap_int_tls_destroy( gopts );
+#endif
 }
 
 /* 
index 4bfc346c70bb83f8651b8983f14638ae21c6d4c3..dff845bc10a1c08acb1f6ca7e26188ced305babb 100644 (file)
@@ -160,14 +160,6 @@ ldap_pvt_tls_destroy( void )
        tls_imp->ti_tls_destroy();
 }
 
-static void
-ldap_exit_tls_destroy( void )
-{
-       struct ldapoptions *lo = LDAP_INT_GLOBAL_OPT();
-
-       ldap_int_tls_destroy( lo );
-}
-
 /*
  * Initialize a particular TLS implementation.
  * Called once per implementation.
@@ -176,7 +168,6 @@ static int
 tls_init(tls_impl *impl, int do_threads )
 {
        static int tls_initialized = 0;
-       int rc;
 
        if ( !tls_initialized++ ) {
 #ifdef LDAP_R_COMPILE
@@ -192,10 +183,7 @@ tls_init(tls_impl *impl, int do_threads )
 #endif
        }
 
-       rc = impl->ti_tls_init();
-
-       atexit( ldap_exit_tls_destroy );
-       return rc;
+       return impl->ti_tls_init();
 }
 
 /*