From 64f06d5accd4cdb9b5edb773f209f0b071c9e8e0 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 10 Aug 2013 05:05:16 -0700 Subject: [PATCH] ITS#7662 cleanup reader txn in mdb_entry_get() --- servers/slapd/back-mdb/id2entry.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/servers/slapd/back-mdb/id2entry.c b/servers/slapd/back-mdb/id2entry.c index a86a25ce7e..db67db77b0 100644 --- a/servers/slapd/back-mdb/id2entry.c +++ b/servers/slapd/back-mdb/id2entry.c @@ -242,6 +242,8 @@ int mdb_entry_return( Entry *e ) { + if ( !e ) + return 0; if ( e->e_private ) { if ( op->o_hdr ) { op->o_tmpfree( e->e_nname.bv_val, op->o_tmpmemctx ); @@ -363,14 +365,7 @@ int mdb_entry_get( return_results: if( rc != LDAP_SUCCESS ) { /* free entry */ - if ( e ) - mdb_entry_return( op, e ); - - if (moi->moi_ref == 1) { - LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next ); - mdb_txn_reset( txn ); - op->o_tmpfree( moi, op->o_tmpmemctx ); - } + mdb_entry_release( op, e, rw ); } else { *ent = e; } -- 2.39.5