From e5f5a4ab5f1f992e2c113e904c65314a0f096ec5 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 26 Aug 2014 19:17:33 +0100 Subject: [PATCH] ITS#7927 fix double-free of searchref --- servers/slapd/back-mdb/search.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-mdb/search.c b/servers/slapd/back-mdb/search.c index 2114c10ad0..d90125e8e4 100644 --- a/servers/slapd/back-mdb/search.c +++ b/servers/slapd/back-mdb/search.c @@ -1019,7 +1019,8 @@ notfound: send_search_reference( op, rs ); - mdb_entry_return( op, e ); + if (e != base) + mdb_entry_return( op, e ); rs->sr_entry = NULL; e = NULL; @@ -1184,7 +1185,7 @@ done: rs->sr_v2ref = NULL; } if (base) - mdb_entry_return( op,base); + mdb_entry_return( op, base ); scope_chunk_ret( op, scopes ); return rs->sr_err; -- 2.39.5