From: Pierangelo Masarati Date: Mon, 12 Apr 2010 16:24:01 +0000 (+0000) Subject: don't free before use X-Git-Tag: MIGRATION_CVS2GIT~636 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5564ee017384580d1e50615f2b2295588f2cd7f8;p=openldap don't free before use --- 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;