]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/rwm.c
Use "pcache" to invoke the overlay instead of "proxycache"
[openldap] / servers / slapd / overlays / rwm.c
index 4ff18d6573aafac930bf906a970f95307f78064f..85d73d2ad07e030d694d63944a1913689a5f2595 100644 (file)
@@ -868,7 +868,7 @@ rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first, int stripEntryDN )
                        /* just count */ ;
 
                if ( last == 0 ) {
-                       /* empty? for now, we leave it in place */
+                       /* empty? leave it in place because of attrsonly and vlv */
                        goto next_attr;
                }
                last--;
@@ -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;
 }