ITS#3914 bug was very close to that leak: rwm_dnattr_rewrite() already freed the original value (all this stuff may need work)

This commit is contained in:
Pierangelo Masarati 2005-08-08 19:49:48 +00:00
parent 47351e3b5c
commit 64af435895

View file

@ -368,7 +368,10 @@ rwm_op_compare( Operation *op, SlapReply *rs )
}
if ( mapped_vals[ 0 ].bv_val != op->orc_ava->aa_value.bv_val ) {
ber_bvreplace_x( &op->orc_ava->aa_value, &mapped_vals[0],
/* NOTE: if we get here, rwm_dnattr_rewrite()
* already freed the old value, so now
* it's invalid */
ber_dupbv_x( &op->orc_ava->aa_value, &mapped_vals[0],
op->o_tmpmemctx );
ber_memfree_x( mapped_vals[ 0 ].bv_val, NULL );
}