also copy modifications we don't deal with, as they will be freed altogether (ITS#5124)

This commit is contained in:
Pierangelo Masarati 2007-09-07 09:38:38 +00:00
parent fe0ea32edc
commit 00ad93ac70

View File

@ -504,14 +504,10 @@ rwm_op_modify( Operation *op, SlapReply *rs )
isupdate = be_shadow_update( op ); isupdate = be_shadow_update( op );
for ( mlp = &op->orm_modlist; *mlp; ) { for ( mlp = &op->orm_modlist; *mlp; ) {
int is_oc = 0; int is_oc = 0;
Modifications *ml; Modifications *ml = *mlp;
struct ldapmapping *mapping = NULL; struct ldapmapping *mapping = NULL;
/* duplicate the modlist */ /* ml points to a temporary mod until needs duplication */
ml = ch_malloc( sizeof( Modifications ));
*ml = **mlp;
*mlp = ml;
if ( ml->sml_desc == slap_schema.si_ad_objectClass if ( ml->sml_desc == slap_schema.si_ad_objectClass
|| ml->sml_desc == slap_schema.si_ad_structuralObjectClass ) || ml->sml_desc == slap_schema.si_ad_structuralObjectClass )
{ {
@ -519,6 +515,15 @@ rwm_op_modify( Operation *op, SlapReply *rs )
} else if ( !isupdate && !get_relax( op ) && ml->sml_desc->ad_type->sat_no_user_mod ) } else if ( !isupdate && !get_relax( op ) && ml->sml_desc->ad_type->sat_no_user_mod )
{ {
ml = ch_malloc( sizeof( Modifications ) );
*ml = **mlp;
if ( (*mlp)->sml_values ) {
ber_bvarray_dup_x( &ml->sml_values, (*mlp)->sml_values, NULL );
if ( (*mlp)->sml_nvalues ) {
ber_bvarray_dup_x( &ml->sml_nvalues, (*mlp)->sml_nvalues, NULL );
}
}
*mlp = ml;
goto next_mod; goto next_mod;
} else { } else {
@ -533,6 +538,11 @@ rwm_op_modify( Operation *op, SlapReply *rs )
} }
} }
/* duplicate the modlist */
ml = ch_malloc( sizeof( Modifications ));
*ml = **mlp;
*mlp = ml;
if ( ml->sml_values != NULL ) { if ( ml->sml_values != NULL ) {
int i, num; int i, num;
struct berval *bva; struct berval *bva;