- attr_normalize( ava->ava_type );
- value_normalize( ava->ava_value.bv_val, attr_syntax( ava->ava_type ) );
+ aa = ch_malloc( sizeof( AttributeAssertion ) );
+ aa->aa_desc = NULL;
+ aa->aa_value = NULL;
+
+ rc = slap_bv2ad( &type, &aa->aa_desc, text );
+ ch_free( type.bv_val );
+
+ if( rc != LDAP_SUCCESS ) {
+ ch_free( value.bv_val );
+ ch_free( aa );
+ return rc;
+ }
+
+ rc = value_normalize( aa->aa_desc, usage, &value, &nvalue, text );
+ ch_free( value.bv_val );
+
+ if( rc != LDAP_SUCCESS ) {
+ ch_free( aa );
+ return rc;
+ }
+
+ aa->aa_value = nvalue;
+ *ava = aa;