From: Pierangelo Masarati Date: Fri, 13 May 2005 19:08:41 +0000 (+0000) Subject: fix cleanup in case of error X-Git-Tag: OPENLDAP_AC_BP~639 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6bd4ef7667f9de08f08207aa28f67285e49d79a5;p=openldap fix cleanup in case of error --- diff --git a/servers/slapd/overlays/rwm.c b/servers/slapd/overlays/rwm.c index b91ba2c17f..85d73d2ad0 100644 --- a/servers/slapd/overlays/rwm.c +++ b/servers/slapd/overlays/rwm.c @@ -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; }