diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index 430162f57c..fb32cb0373 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -532,6 +532,10 @@ finish:; ldap_back_quarantine( op, rs ); } + if ( filter.bv_val != op->ors_filterstr.bv_val ) { + op->o_tmpfree( filter.bv_val, op->o_tmpmemctx ); + } + #if 0 /* let send_ldap_result play cleanup handlers (ITS#4645) */ if ( rc != SLAPD_ABANDON ) @@ -557,10 +561,6 @@ finish:; rs->sr_matched = save_matched; } - if ( filter.bv_val != op->ors_filterstr.bv_val ) { - op->o_tmpfree( filter.bv_val, op->o_tmpmemctx ); - } - if ( rs->sr_text ) { if ( freetext ) { LDAP_FREE( (char *)rs->sr_text );