]> git.sur5r.net Git - openldap/commitdiff
Fix previous commit, free in wrong place
authorHoward Chu <hyc@openldap.org>
Sat, 11 May 2002 06:58:13 +0000 (06:58 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 11 May 2002 06:58:13 +0000 (06:58 +0000)
servers/slapd/sasl.c

index f9a083d9d161aada218ed88092f87665285cb5ed..807418a558051e362f763319a7a85e2db7b0bd45 100644 (file)
@@ -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 );