From b86467e0f847ecb317751548e98bcf60a9a60c1e Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 30 Aug 2005 10:36:24 +0000 Subject: [PATCH] cleanup previous commit (thanks to Hallvard) --- servers/slapd/back-meta/bind.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/servers/slapd/back-meta/bind.c b/servers/slapd/back-meta/bind.c index 0cb7f3337e..7defb3d424 100644 --- a/servers/slapd/back-meta/bind.c +++ b/servers/slapd/back-meta/bind.c @@ -667,6 +667,7 @@ meta_back_op_result( rerr = LDAP_SUCCESS; char *rmsg = NULL; char *rmatch = NULL; + void *rmatch_ctx = NULL; if ( candidate != META_TARGET_NONE ) { metasingleconn_t *msc = &mc->mc_conns[ candidate ]; @@ -785,27 +786,17 @@ meta_back_op_result( ber_str2bv( rmatch, 0, 0, &dn ); if ( dnPretty( NULL, &dn, &pdn, op->o_tmpmemctx ) == LDAP_SUCCESS ) { - rs->sr_matched = pdn.bv_val; ldap_memfree( rmatch ); - rmatch = NULL; - } else { - rs->sr_matched = rmatch; + rmatch_ctx = op->o_tmpmemctx; + rmatch = pdn.bv_val; } - - } else { - rs->sr_matched = NULL; } send_ldap_result( op, rs ); if ( rmsg != NULL ) { ber_memfree( rmsg ); } - if ( rs->sr_matched != NULL ) { - if ( rmatch == NULL ) { - ber_memfree_x( rs->sr_matched, op->o_tmpmemctx ); - - } else { - ldap_memfree( rmatch ); - } + if ( rmatch != NULL ) { + ber_memfree_x( rmatch, rmatch_ctx ); rs->sr_matched = NULL; } rs->sr_text = NULL; -- 2.39.5