]> git.sur5r.net Git - openldap/commitdiff
ITS#4489 fix slap_tls_ld cleanup
authorHoward Chu <hyc@openldap.org>
Thu, 13 Apr 2006 21:49:25 +0000 (21:49 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 13 Apr 2006 21:49:25 +0000 (21:49 +0000)
servers/slapd/main.c

index 79a83434dbd7fcf38d585daca08b7489771b3159..76f30adf45729f19e83df3deaafcd10881dc1dc2 100644 (file)
@@ -963,8 +963,10 @@ stop:
        /* Setting it to itself decreases refcount, allowing it to be freed
         * when the LD is freed.
         */
-       ldap_pvt_tls_set_option( slap_tls_ld, LDAP_OPT_X_TLS_CTX, slap_tls_ctx );
-       ldap_ld_free( slap_tls_ld, 0, NULL, NULL );
+       if ( slap_tls_ld ) {
+               ldap_pvt_tls_set_option( slap_tls_ld, LDAP_OPT_X_TLS_CTX, slap_tls_ctx );
+               ldap_unbind( slap_tls_ld );
+       }
        ldap_pvt_tls_destroy();
 #endif