]> git.sur5r.net Git - openldap/commitdiff
fix cleanup in case of error
authorPierangelo Masarati <ando@openldap.org>
Fri, 13 May 2005 19:08:41 +0000 (19:08 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 13 May 2005 19:08:41 +0000 (19:08 +0000)
servers/slapd/overlays/rwm.c

index b91ba2c17fd670dcdf3a9dd99fd70616f3c0572b..85d73d2ad07e030d694d63944a1913689a5f2595 100644 (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;
 }