+ /* If attr existed and value was too short, free it
+ * and replace it.
+ */
+ if ( a ) {
+ ch_free( a->a_vals[0].bv_val );
+ ber_dupbv( a->a_vals, &max_committed_csn );
+ } else {
+ /* Else it never existed, merge it in. */
+ attr_merge_one( e, slap_schema.si_ad_contextCSN,
+ &max_committed_csn, NULL );
+ }
+ } else {
+ /* The usual case - just overwrite the old with the new */
+ strcpy( a->a_vals[0].bv_val, max_committed_csn.bv_val );
+ a->a_vals[0].bv_len = max_committed_csn.bv_len;