]> git.sur5r.net Git - openldap/commitdiff
Cleanup prev commit
authorHoward Chu <hyc@openldap.org>
Thu, 14 Oct 2010 03:11:26 +0000 (03:11 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 14 Oct 2010 03:11:26 +0000 (03:11 +0000)
libraries/libldap/cyrus.c

index a223d4d4191a4b3a5f55f4dd3b4a829bdd1c57e8..4420bd03c18ad12cc97ae27fcad1e2653f56e909 100644 (file)
@@ -395,7 +395,7 @@ ldap_int_sasl_bind(
        sasl_ssf_t              *ssf;
        sasl_conn_t             *ctx;
        sasl_interact_t *prompts = NULL;
-       struct berval   ccred;
+       struct berval   ccred = BER_BVNULL;
        int saslrc, rc;
        unsigned credlen;
 
@@ -504,8 +504,6 @@ ldap_int_sasl_bind(
                sasl_setprop( ctx, SASL_SEC_PROPS,
                        &ld->ld_options.ldo_sasl_secprops );
 
-               ccred.bv_val = NULL;
-               ccred.bv_len = 0;
                mech = NULL;
 
                do {
@@ -521,6 +519,7 @@ ldap_int_sasl_bind(
 
                        if( pmech == NULL && mech != NULL ) {
                                pmech = mech;
+                               *rmech = mech;
 
                                if( flags != LDAP_SASL_QUIET ) {
                                        fprintf(stderr,
@@ -536,7 +535,6 @@ ldap_int_sasl_bind(
 
                                if( res != LDAP_SUCCESS ) break;
                        }
-                       *rmech = mech;
                } while ( saslrc == SASL_INTERACT );
 
        } else {