From: Pierangelo Masarati Date: Fri, 30 Jan 2009 01:29:32 +0000 (+0000) Subject: muck with flags only when needed (ITS#5898) X-Git-Tag: ACLCHECK_0~911 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=97bd3479c463fdb46eaf5dd7adcd8d9676d8de5e;p=openldap muck with flags only when needed (ITS#5898) --- diff --git a/servers/slapd/overlays/dynlist.c b/servers/slapd/overlays/dynlist.c index 655151a69a..1210b6582a 100644 --- a/servers/slapd/overlays/dynlist.c +++ b/servers/slapd/overlays/dynlist.c @@ -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; } }