fix cleanup in case of error

This commit is contained in:
Pierangelo Masarati 2005-05-13 19:08:41 +00:00
parent feeeabcd68
commit 6bd4ef7667

View File

@ -1045,6 +1045,18 @@ rwm_send_entry( Operation *op, SlapReply *rs )
return SLAP_CB_CONTINUE;
fail:;
if ( e != NULL && e != rs->sr_entry ) {
if ( e->e_name.bv_val == dn.bv_val ) {
BER_BVZERO( &e->e_name );
}
if ( e->e_nname.bv_val == ndn.bv_val ) {
BER_BVZERO( &e->e_nname );
}
entry_free( e );
}
if ( !BER_BVISNULL( &dn ) ) {
ch_free( dn.bv_val );
}
@ -1053,10 +1065,6 @@ fail:;
ch_free( ndn.bv_val );
}
if ( e != NULL && e != rs->sr_entry ) {
entry_free( e );
}
return rc;
}