free( tmp.sml_type.bv_val );
goto done;
}
- mod = (Modifications *) ch_malloc( sizeof(Modifications)
- + tmp.sml_type.bv_len + 1);
+ mod = (Modifications *) ch_malloc( sizeof(Modifications) );
mod->sml_op = LDAP_MOD_ADD;
mod->sml_next = NULL;
mod->sml_desc = NULL;
- mod->sml_type.bv_val = (char *)(mod+1);
- strcpy(mod->sml_type.bv_val, tmp.sml_type.bv_val);
- mod->sml_type.bv_len = tmp.sml_type.bv_len;
+ mod->sml_type = tmp.sml_type;
mod->sml_bvalues = tmp.sml_bvalues;
*modtail = mod;
goto cleanup;
}
- mod = (Modifications *) ch_malloc( sizeof(Modifications)
- + tmp.sml_type.bv_len + 1);
- mod->sml_type.bv_val = (char *)(mod+1);
- strcpy(mod->sml_type.bv_val, tmp.sml_type.bv_val);
- mod->sml_type.bv_len = tmp.sml_type.bv_len;
+ mod = (Modifications *) ch_malloc( sizeof(Modifications) );
+ mod->sml_type = tmp.sml_type;
mod->sml_bvalues = tmp.sml_bvalues;
mod->sml_desc = NULL;
*modtail = mod;
if ( tmpval.bv_len ) {
mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
mod->sml_op = mop;
+ mod->sml_type.bv_val = NULL;
mod->sml_desc = slap_schema.si_ad_structuralObjectClass;
mod->sml_bvalues = (BVarray) ch_malloc( 2 * sizeof( struct berval ) );
ber_dupbv( &mod->sml_bvalues[0], &tmpval );
mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
mod->sml_op = mop;
+ mod->sml_type.bv_val = NULL;
mod->sml_desc = slap_schema.si_ad_entryUUID;
mod->sml_bvalues = (BVarray) ch_malloc( 2 * sizeof( struct berval ) );
ber_dupbv( &mod->sml_bvalues[0], &tmpval );
mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
mod->sml_op = mop;
+ mod->sml_type.bv_val = NULL;
mod->sml_desc = slap_schema.si_ad_creatorsName;
mod->sml_bvalues = (BVarray) ch_malloc( 2 * sizeof( struct berval ) );
ber_dupbv( &mod->sml_bvalues[0], &name );
mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
mod->sml_op = mop;
+ mod->sml_type.bv_val = NULL;
mod->sml_desc = slap_schema.si_ad_createTimestamp;
mod->sml_bvalues = (BVarray) ch_malloc( 2 * sizeof( struct berval ) );
ber_dupbv( &mod->sml_bvalues[0], ×tamp );
mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
mod->sml_op = mop;
+ mod->sml_type.bv_val = NULL;
mod->sml_desc = slap_schema.si_ad_entryCSN;
mod->sml_bvalues = (BVarray) ch_malloc( 2 * sizeof( struct berval ) );
ber_dupbv( &mod->sml_bvalues[0], &csn );
mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
mod->sml_op = mop;
+ mod->sml_type.bv_val = NULL;
mod->sml_desc = slap_schema.si_ad_modifiersName;
mod->sml_bvalues = (BVarray) ch_malloc( 2 * sizeof( struct berval ) );
ber_dupbv( &mod->sml_bvalues[0], &name );
mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
mod->sml_op = mop;
+ mod->sml_type.bv_val = NULL;
mod->sml_desc = slap_schema.si_ad_modifyTimestamp;
mod->sml_bvalues = (BVarray) ch_malloc( 2 * sizeof( struct berval ) );
ber_dupbv( &mod->sml_bvalues[0], ×tamp );