]> git.sur5r.net Git - openldap/commitdiff
use result of validation (ITS#4028)
authorPierangelo Masarati <ando@openldap.org>
Mon, 19 Sep 2005 09:06:29 +0000 (09:06 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 19 Sep 2005 09:06:29 +0000 (09:06 +0000)
servers/slapd/back-meta/search.c

index f1521b9b92ee502c0d60f7490c4825857a2563d9..1f1408d19c49b3c8a2054f4e2385cbff347f200d 100644 (file)
@@ -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 &&