mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
fix cleanup in case of error
This commit is contained in:
parent
feeeabcd68
commit
6bd4ef7667
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user