From c1f04881be2d166633d5f5cf1c1c705379155b85 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Wed, 10 Sep 2014 04:08:18 +0400 Subject: [PATCH] ITS#7915 fix memory leaks in previous patch --- servers/slapd/back-mdb/id2entry.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-mdb/id2entry.c b/servers/slapd/back-mdb/id2entry.c index 6cbeaf88fb..1be3626798 100644 --- a/servers/slapd/back-mdb/id2entry.c +++ b/servers/slapd/back-mdb/id2entry.c @@ -272,9 +272,11 @@ int mdb_entry_release( /* slapMode : SLAP_SERVER_MODE, SLAP_TOOL_MODE, SLAP_TRUNCATE_MODE, SLAP_UNDEFINED_MODE */ + int release = 1; if ( slapMode & SLAP_SERVER_MODE ) { OpExtra *oex; LDAP_SLIST_FOREACH( oex, &op->o_extra, oe_next ) { + release = 0; if ( oex->oe_key == mdb ) { mdb_entry_return( op, e ); moi = (mdb_op_info *)oex; @@ -291,9 +293,10 @@ int mdb_entry_release( break; } } - } else { - mdb_entry_return( op, e ); } + + if (release) + mdb_entry_return( op, e ); return 0; } -- 2.39.5