]> git.sur5r.net Git - openldap/commitdiff
ITS#7927 fix double-free of searchref
authorHoward Chu <hyc@openldap.org>
Tue, 26 Aug 2014 18:17:33 +0000 (19:17 +0100)
committerHoward Chu <hyc@openldap.org>
Tue, 26 Aug 2014 18:17:33 +0000 (19:17 +0100)
servers/slapd/back-mdb/search.c

index 2114c10ad0ca6f5f9f7a1521fd8390de8cd6304f..d90125e8e46dcc0d5688ec5868b447f0b666c8f5 100644 (file)
@@ -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;