]> git.sur5r.net Git - openldap/commitdiff
Fix - slapcat doesn't set op->o_hdr for tmpmemctx
authorHoward Chu <hyc@openldap.org>
Sat, 10 Sep 2011 08:12:50 +0000 (01:12 -0700)
committerHoward Chu <hyc@openldap.org>
Sat, 10 Sep 2011 08:12:50 +0000 (01:12 -0700)
servers/slapd/back-mdb/id2entry.c

index 5717c358711c6de7bf4347570cfa431a9f472435..4ea650aa18fd95ec34b31fd74cc98ffb253bd6a2 100644 (file)
@@ -204,10 +204,17 @@ int mdb_entry_return(
 )
 {
        if ( e->e_private ) {
-               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->e_attrs, op->o_tmpmemctx );
-               op->o_tmpfree( e, op->o_tmpmemctx );
+               if ( slapMode & SLAP_TOOL_MODE ) {
+                       ch_free( e->e_nname.bv_val );
+                       ch_free( e->e_name.bv_val );
+                       ch_free( e->e_attrs );
+                       ch_free( e );
+               } else {
+                       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->e_attrs, op->o_tmpmemctx );
+                       op->o_tmpfree( e, op->o_tmpmemctx );
+               }
        } else {
                entry_free( e );
        }