From 5564ee017384580d1e50615f2b2295588f2cd7f8 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 12 Apr 2010 16:24:01 +0000 Subject: [PATCH] don't free before use --- servers/slapd/overlays/rwmmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/servers/slapd/overlays/rwmmap.c b/servers/slapd/overlays/rwmmap.c index 95eec2f922..436ffba704 100644 --- a/servers/slapd/overlays/rwmmap.c +++ b/servers/slapd/overlays/rwmmap.c @@ -789,9 +789,6 @@ rwm_filter_map_rewrite( case REWRITE_REGEXEC_OK: if ( !BER_BVISNULL( fstr ) ) { fstr->bv_len = strlen( fstr->bv_val ); - if ( fstr->bv_val != ftmp.bv_val ) { - ch_free( ftmp.bv_val ); - } } else { *fstr = ftmp; @@ -800,6 +797,9 @@ rwm_filter_map_rewrite( Debug( LDAP_DEBUG_ARGS, "[rw] %s: \"%s\" -> \"%s\"\n", fdc.ctx, ftmp.bv_val, fstr->bv_val ); + if ( fstr->bv_val != ftmp.bv_val ) { + ch_free( ftmp.bv_val ); + } rc = LDAP_SUCCESS; break; -- 2.39.5