]> git.sur5r.net Git - openldap/commitdiff
really fix the invalid free issue (I totally overlooked this piece of code)
authorPierangelo Masarati <ando@openldap.org>
Thu, 21 Jul 2005 20:23:47 +0000 (20:23 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 21 Jul 2005 20:23:47 +0000 (20:23 +0000)
servers/slapd/sasl.c

index 91b56529336de3f5d2b6d3f570b6d5897d50fdb3..56e016efccb89bbcf5dd5c72cdaed250ad35532c 100644 (file)
@@ -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,