]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/dynlist.c
Add some asserts on CSN validity
[openldap] / servers / slapd / overlays / dynlist.c
index 655151a69a4f1d42118dce59c6bee6b7840270b5..1210b6582a61d67de7eac416cd27328711fe3854 100644 (file)
@@ -452,12 +452,13 @@ dynlist_prepare_entry( Operation *op, SlapReply *rs, dynlist_info_t *dli )
                o.o_groups = NULL;
        }
 
+       e_flags = rs->sr_flags;
        if ( !( rs->sr_flags & REP_ENTRY_MODIFIABLE ) ) {
                e = entry_dup( rs->sr_entry );
+               e_flags |= ( REP_ENTRY_MODIFIABLE | REP_ENTRY_MUSTBEFREED );
        } else {
                e = rs->sr_entry;
        }
-       e_flags = rs->sr_flags | ( REP_ENTRY_MODIFIABLE | REP_ENTRY_MUSTBEFREED );
 
        dlc.dlc_e = e;
        dlc.dlc_dli = dli;
@@ -855,6 +856,8 @@ done:;
 
                if ( r.sr_flags & REP_ENTRY_MUSTBEFREED ) {
                        entry_free( r.sr_entry );
+                       r.sr_entry = NULL;
+                       r.sr_flags ^= REP_ENTRY_MUSTBEFREED;
                }
        }