X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fvalue.c;h=071286a0ee506f2d825d46856dcc14968f4a9332;hb=01c38dd6ea7f02cfdc9f77f9299771a4ef6ce968;hp=dbd30cff8f055ed371843ffacbb8dff3d9193990;hpb=0e2b26986e83fc44a764fc9c9fbe1c728abfd8f4;p=openldap diff --git a/servers/slapd/value.c b/servers/slapd/value.c index dbd30cff8f..071286a0ee 100644 --- a/servers/slapd/value.c +++ b/servers/slapd/value.c @@ -75,7 +75,7 @@ value_add( } v2 = &(*vals)[n]; - for ( ; !BER_BVISNULL( addvals ); v2++, addvals++ ) { + for ( n = 0 ; n < nn; v2++, addvals++ ) { ber_dupbv( v2, addvals ); if ( BER_BVISNULL( v2 ) ) break; } @@ -229,14 +229,14 @@ int value_find_ex( return LDAP_INAPPROPRIATE_MATCHING; } - assert(SLAP_IS_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH( flags )); + assert( SLAP_IS_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH( flags ) != 0 ); if( !SLAP_IS_MR_ASSERTED_VALUE_NORMALIZED_MATCH( flags ) && mr->smr_normalize ) { rc = (mr->smr_normalize)( flags & (SLAP_MR_TYPE_MASK|SLAP_MR_SUBTYPE_MASK|SLAP_MR_VALUE_OF_SYNTAX), - ad ? ad->ad_type->sat_syntax : NULL, + ad->ad_type->sat_syntax, mr, val, &nval, ctx ); if( rc != LDAP_SUCCESS ) { @@ -691,8 +691,7 @@ ordered_value_add( Attribute **ap; anum = 0; for ( ap=&e->e_attrs; *ap; ap = &(*ap)->a_next ) ; - a = ch_calloc( 1, sizeof(Attribute) ); - a->a_desc = ad; + a = attr_alloc( ad ); *ap = a; } @@ -718,6 +717,8 @@ ordered_value_add( next[ 0 ] != '}' || next - vals[i].bv_val > vals[i].bv_len ) { + ch_free( nnew ); + ch_free( new ); return -1; } if ( k > anum ) k = -1;