From: Howard Chu Date: Sat, 11 May 2002 06:58:13 +0000 (+0000) Subject: Fix previous commit, free in wrong place X-Git-Tag: OPENLDAP_REL_ENG_2_MP~75 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=379f84ba474c0b9c1e2b94c8dadf16b6f11948d6;p=openldap Fix previous commit, free in wrong place --- diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index f9a083d9d1..807418a558 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -233,16 +233,16 @@ int slap_sasl_getdn( Connection *conn, char *id, int len, dn->bv_val = ch_malloc( len+1 ); p = slap_strcopy( dn->bv_val, "uid=" ); p = slap_strcopy( p, c1 ); - ch_free( c1 ); if( realm ) { p = slap_strcopy( p, ",cn=" ); p = slap_strcopy( p, realm ); - realm[-1] = '@'; } else if( user_realm && *user_realm ) { p = slap_strcopy( p, ",cn=" ); p = slap_strcopy( p, user_realm ); } + ch_free( c1 ); + if( conn->c_sasl_bind_mech.bv_len ) { p = slap_strcopy( p, ",cn=" ); p = slap_strcopy( p, conn->c_sasl_bind_mech.bv_val );