]> git.sur5r.net Git - openldap/commitdiff
ITS#7099 fix mdb_entry_return for tool mode
authorHoward Chu <hyc@openldap.org>
Tue, 29 Nov 2011 13:42:46 +0000 (05:42 -0800)
committerHoward Chu <hyc@openldap.org>
Tue, 29 Nov 2011 13:42:46 +0000 (05:42 -0800)
Originally, overlays were not supposed to take effect in tool mode.
Apparently that's no longer the case...

servers/slapd/back-mdb/id2entry.c

index ea9df05f2d4fea1c0dbd4dfe9de7fc7c73122415..a4456c8d062ad7a5dda20853f9503255e08a388b 100644 (file)
@@ -217,14 +217,14 @@ int mdb_entry_return(
 )
 {
        if ( e->e_private ) {
-               if ( slapMode & SLAP_TOOL_MODE ) {
-                       ch_free( e->e_nname.bv_val );
-                       ch_free( e->e_name.bv_val );
-                       ch_free( e );
-               } else {
+               if ( op->o_hdr ) {
                        op->o_tmpfree( e->e_nname.bv_val, op->o_tmpmemctx );
                        op->o_tmpfree( e->e_name.bv_val, op->o_tmpmemctx );
                        op->o_tmpfree( e, op->o_tmpmemctx );
+               } else {
+                       ch_free( e->e_nname.bv_val );
+                       ch_free( e->e_name.bv_val );
+                       ch_free( e );
                }
        } else {
                entry_free( e );