diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index 4497971d61..4ddaa1a793 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -106,8 +106,10 @@ ldap_back_bind( mdn.bv_val = NULL; if ( li->savecred ) { - if ( lc->cred.bv_val ) + if ( lc->cred.bv_val ) { + memset( lc->cred.bv_val, 0, lc->cred.bv_len ); ch_free( lc->cred.bv_val ); + } ber_dupbv( &lc->cred, &op->oq_bind.rb_cred ); ldap_set_rebind_proc( lc->ld, ldap_back_rebind, lc ); } diff --git a/servers/slapd/back-ldap/init.c b/servers/slapd/back-ldap/init.c index efa8b88a4e..f2a71e0ebb 100644 --- a/servers/slapd/back-ldap/init.c +++ b/servers/slapd/back-ldap/init.c @@ -147,6 +147,7 @@ ldap_back_conn_free( ch_free( lc->bound_dn.bv_val ); } if ( lc->cred.bv_val ) { + memset( lc->cred.bv_val, 0, lc->cred.bv_len ); ch_free( lc->cred.bv_val ); } if ( lc->local_dn.bv_val ) {