From: Howard Chu Date: Wed, 3 Oct 2007 09:40:08 +0000 (+0000) Subject: ITS#5060 take care of entry cleanup when using X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~560 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4c4cb4921b354af8330efdc2b786f807c96b31ed;p=openldap ITS#5060 take care of entry cleanup when using pblock_set(SLAPI_SEARCH_RESULT_ENTRY) --- diff --git a/servers/slapd/slapi/slapi_pblock.c b/servers/slapd/slapi/slapi_pblock.c index 136a5586b1..3ff855dc42 100644 --- a/servers/slapd/slapi/slapi_pblock.c +++ b/servers/slapd/slapi/slapi_pblock.c @@ -1176,7 +1176,14 @@ pblock_set( Slapi_PBlock *pb, int param, void *value ) break; case SLAPI_SEARCH_RESULT_ENTRY: PBLOCK_ASSERT_OP( pb, 0 ); + if ( pb->pb_rs->sr_flags & REP_ENTRY_MUSTBEFREED ) { + entry_free( pb->pb_rs->sr_entry ); + } else if ( pb->pb_rs->sr_flags & REP_ENTRY_MUSTRELEASE ) { + be_entry_release_r( pb->pb_op, pb->pb_rs->sr_entry ); + pb->pb_rs->sr_flags ^= REP_ENTRY_MUSTRELEASE; + } pb->pb_rs->sr_entry = (Slapi_Entry *)value; + pb->pb_rs->sr_flags |= REP_ENTRY_MUSTBEFREED; break; case SLAPI_BIND_RET_SASLCREDS: PBLOCK_ASSERT_OP( pb, 0 );