]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/sasl.c
Added bdb_attribute and bdb_group ACL support routines
[openldap] / servers / slapd / sasl.c
index ca814513c7cdcb436fee00cda58530941b0dc34e..f2907b47dba732148b447c182ab4cc2d8a413d70 100644 (file)
@@ -9,12 +9,11 @@
 #include <ac/stdlib.h>
 #include <stdio.h>
 
-#include "slap.h"
-#include "proto-slap.h"
-
 #include <lber.h>
 #include <ldap_log.h>
 
+#include "slap.h"
+
 #ifdef HAVE_CYRUS_SASL
 #include <limits.h>
 #include <sasl.h>
@@ -25,6 +24,7 @@
 #include <lutil.h>
 #endif
 
+
 static sasl_security_properties_t sasl_secprops;
 
 static int
@@ -636,10 +636,9 @@ int slap_sasl_bind(
        }
 
        if ( !conn->c_sasl_bind_in_progress ) {
-               const char *kludge = "";
                sc = sasl_server_start( ctx,
                        conn->c_sasl_bind_mech,
-                       cred->bv_len ? cred->bv_val : kludge,
+                       cred->bv_len ? cred->bv_val : "",
                        cred->bv_len,
                        (char **)&response.bv_val, &reslen, &errstr );
 
@@ -714,6 +713,10 @@ int slap_sasl_bind(
                        NULL, errstr, NULL, NULL );
        }
 
+       if( response.bv_len ) {
+               ch_free( response.bv_val );
+       }
+
 #ifdef NEW_LOGGING
        LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
                   "slap_sasl_bind: rc=%d\n", rc ));