]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/unbind.c
ITS#1730
[openldap] / libraries / libldap / unbind.c
index b138161a41fd1a5b5ae3b551357e1af0606501d3..4474920bf7bc97d65ce867aa47b7bd012384e8dc 100644 (file)
@@ -1,6 +1,6 @@
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 /*  Portions
@@ -58,7 +58,11 @@ ldap_unbind_ext_s(
 int
 ldap_unbind( LDAP *ld )
 {
+#ifdef NEW_LOGGING
+       LDAP_LOG (( "unbind", LDAP_LEVEL_ENTRY, "ldap_unbind\n" ));
+#else
        Debug( LDAP_DEBUG_TRACE, "ldap_unbind\n", 0, 0, 0 );
+#endif
 
        return( ldap_unbind_ext( ld, NULL, NULL ) );
 }
@@ -131,12 +135,32 @@ ldap_ld_free(
                ld->ld_options.ldo_tm_net = NULL;
        }
 
+#ifdef HAVE_CYRUS_SASL
+       if ( ld->ld_options.ldo_def_sasl_mech != NULL ) {
+               LDAP_FREE( ld->ld_options.ldo_def_sasl_mech );
+               ld->ld_options.ldo_def_sasl_mech = NULL;
+       }
+
+       if ( ld->ld_options.ldo_def_sasl_realm != NULL ) {
+               LDAP_FREE( ld->ld_options.ldo_def_sasl_realm );
+               ld->ld_options.ldo_def_sasl_realm = NULL;
+       }
+
+       if ( ld->ld_options.ldo_def_sasl_authcid != NULL ) {
+               LDAP_FREE( ld->ld_options.ldo_def_sasl_authcid );
+               ld->ld_options.ldo_def_sasl_authcid = NULL;
+       }
+
+       if ( ld->ld_options.ldo_def_sasl_authzid != NULL ) {
+               LDAP_FREE( ld->ld_options.ldo_def_sasl_authzid );
+               ld->ld_options.ldo_def_sasl_authzid = NULL;
+       }
+#endif
+
        ber_sockbuf_free( ld->ld_sb );   
    
        LDAP_FREE( (char *) ld );
    
-       WSACleanup();
-
        return( err );
 }
 
@@ -156,7 +180,11 @@ ldap_send_unbind(
 {
        BerElement      *ber;
 
+#ifdef NEW_LOGGING
+       LDAP_LOG (( "unbind", LDAP_LEVEL_ENTRY, "ldap_send_unbind\n" ));
+#else
        Debug( LDAP_DEBUG_TRACE, "ldap_send_unbind\n", 0, 0, 0 );
+#endif
 
 #ifdef LDAP_CONNECTIONLESS
        if (LDAP_IS_UDP(ld))