From 16cbeb5e65197856e17dc1f1e8063596c25717d3 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 10 Sep 2011 01:12:50 -0700 Subject: [PATCH] Fix - slapcat doesn't set op->o_hdr for tmpmemctx --- servers/slapd/back-mdb/id2entry.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/servers/slapd/back-mdb/id2entry.c b/servers/slapd/back-mdb/id2entry.c index 5717c35871..4ea650aa18 100644 --- a/servers/slapd/back-mdb/id2entry.c +++ b/servers/slapd/back-mdb/id2entry.c @@ -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 ); } -- 2.39.5