From ae0b39e3cc9dd0f982e87c16c9e821d074319693 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 19 Sep 2005 09:06:29 +0000 Subject: [PATCH] use result of validation (ITS#4028) --- servers/slapd/back-meta/search.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index f1521b9b92..1f1408d19c 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -1054,11 +1054,29 @@ meta_send_entry( &attr->a_vals[i] ); } + if ( rc ) { + LBER_FREE( attr->a_vals[i].bv_val ); + if ( --last == i ) { + BER_BVZERO( &attr->a_vals[ i ] ); + break; + } + attr->a_vals[i] = attr->a_vals[last]; + BER_BVZERO( &attr->a_vals[last] ); + i--; + continue; + } + if ( pretty ) { LBER_FREE( attr->a_vals[i].bv_val ); attr->a_vals[i] = pval; } } + + if ( last == 0 ) { + ch_free( attr->a_vals ); + ch_free( attr ); + goto next_attr; + } } if ( last && attr->a_desc->ad_type->sat_equality && -- 2.39.5