From 49619058eed1877f58f5f6f1fc696d8a4d711562 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 21 Jul 2005 20:23:47 +0000 Subject: [PATCH] really fix the invalid free issue (I totally overlooked this piece of code) --- servers/slapd/sasl.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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, -- 2.39.5