From: Pierangelo Masarati Date: Thu, 21 Jul 2005 20:23:47 +0000 (+0000) Subject: really fix the invalid free issue (I totally overlooked this piece of code) X-Git-Tag: OPENLDAP_AC_BP~281 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=49619058eed1877f58f5f6f1fc696d8a4d711562;p=openldap really fix the invalid free issue (I totally overlooked this piece of code) --- diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index 91b5652933..56e016efcc 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -654,7 +654,17 @@ slap_sasl_authorize( return SASL_NOAUTHZ; } - conn->c_sasl_authz_dn = authzDN; + /* FIXME: we need yet another dup because slap_sasl_getdn() + * is using the bind operation slab */ + if ( conn->c_sasl_bindop ) { + ber_dupbv( &conn->c_sasl_authz_dn, &authzDN ); + slap_sl_free( authzDN.bv_val, + conn->c_sasl_bindop->o_tmpmemctx ); + + } else { + conn->c_sasl_authz_dn = authzDN; + } + ok: if (conn->c_sasl_bindop) { Statslog( LDAP_DEBUG_STATS,