]> git.sur5r.net Git - openldap/commitdiff
ITS#5687 more cleanup fixes
authorHoward Chu <hyc@openldap.org>
Sat, 6 Sep 2008 02:11:26 +0000 (02:11 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 6 Sep 2008 02:11:26 +0000 (02:11 +0000)
servers/slapd/overlays/rwm.c

index 3e515481ee8768ab09007c3ecb1561071fd50c16..6213cff9aeddb758b498d464294624b9a2748852 100644 (file)
@@ -59,13 +59,16 @@ rwm_op_cleanup( Operation *op, SlapReply *rs )
                op->o_req_ndn = ros->ro_ndn;
 
                if ( !BER_BVISNULL( &ros->r_dn )
-                       && ros->r_dn.bv_val != ros->r_ndn.bv_val )
+                       && ros->r_dn.bv_val != ros->r_ndn.bv_val
+                       && ros->r_dn.bv_val != ros->ro_dn.bv_val )
                {
                        ch_free( ros->r_dn.bv_val );
                        BER_BVZERO( &ros->r_dn );
                }
 
-               if ( !BER_BVISNULL( &ros->r_ndn ) ) {
+               if ( !BER_BVISNULL( &ros->r_ndn )
+                       && ros->r_ndn.bv_val != ros->ro_ndn.bv_val )
+               {
                        ch_free( ros->r_ndn.bv_val );
                        BER_BVZERO( &ros->r_ndn );
                }