+ size = i * sizeof(char *) + k;
+ if ( size > 0 ) {
+ char *a_flags;
+ e_flags = SLAP_CALLOC ( 1, i * sizeof(char *) + k );
+ if( e_flags == NULL ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, ERR,
+ "send_search_entry: conn %lu SLAP_CALLOC failed\n",
+ conn ? conn->c_connid : 0, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "send_search_entry: SLAP_CALLOC failed\n", 0, 0, 0 );
+#endif
+ ber_free( ber, 1 );
+
+ send_ldap_result( conn, op, LDAP_OTHER,
+ NULL, "memory error",
+ NULL, NULL );
+ goto error_return;
+ }
+ a_flags = (char *)(e_flags + i);
+ memset( a_flags, 0, k );
+ for ( a = e->e_attrs, i=0; a != NULL; a = a->a_next, i++ ) {
+ for ( j = 0; a->a_vals[j].bv_val != NULL; j++ );
+ e_flags[i] = a_flags;
+ a_flags += j;
+ }
+
+ rc = filter_matched_values(be, conn, op, e->e_attrs, &e_flags) ;
+ if ( rc == -1 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, ERR,
+ "send_search_entry: conn %lu matched values filtering failed\n",
+ conn ? conn->c_connid : 0, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "matched values filtering failed\n", 0, 0, 0 );
+#endif
+ ber_free( ber, 1 );
+
+ send_ldap_result( conn, op, LDAP_OTHER,
+ NULL, "matched values filtering error",
+ NULL, NULL );
+ goto error_return;
+ }
+ }
+ }
+
+ for ( a = e->e_attrs, j = 0; a != NULL; a = a->a_next, j++ ) {