]> git.sur5r.net Git - openldap/commitdiff
handle r_dn == r_ndn
authorPierangelo Masarati <ando@openldap.org>
Mon, 19 Mar 2007 15:44:58 +0000 (15:44 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 19 Mar 2007 15:44:58 +0000 (15:44 +0000)
servers/slapd/overlays/rwm.c

index 4e87d36dd2b05098e299f092f6df37b6f482f5ab..8bdf9355bbc5394e7d3f68cd6d5cd89ac2360e2e 100644 (file)
@@ -55,8 +55,17 @@ rwm_op_cleanup( Operation *op, SlapReply *rs )
                op->o_req_dn = ros->ro_dn;
                op->o_req_ndn = ros->ro_ndn;
 
-               if ( !BER_BVISEMPTY( &ros->r_dn )) ch_free( ros->r_dn.bv_val );
-               if ( !BER_BVISEMPTY( &ros->r_ndn )) ch_free( ros->r_ndn.bv_val );
+               if ( !BER_BVISNULL( &ros->r_dn )
+                       && ros->r_dn.bv_val != ros->r_ndn.bv_val )
+               {
+                       ch_free( ros->r_dn.bv_val );
+                       BER_BVZERO( &ros->r_dn );
+               }
+
+               if ( !BER_BVISNULL( &ros->r_ndn ) ) {
+                       ch_free( ros->r_ndn.bv_val );
+                       BER_BVZERO( &ros->r_ndn );
+               }
 
                switch( ros->r_tag ) {
                case LDAP_REQ_COMPARE: