From be53e8265065e7de61a0996e37732f44e22fdec7 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 21 May 2005 14:53:05 +0000 Subject: [PATCH] fix entry DN free --- servers/slapd/back-ldap/search.c | 4 ++-- servers/slapd/back-meta/search.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index 2c6d296f5c..3a16c4d818 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -275,8 +275,8 @@ fail:; rs->sr_operational_attrs = NULL; rs->sr_flags = 0; abort = send_search_entry( op, rs ); - if ( !BER_BVISNULL( &ent.e_name ) && ( ent.e_name.bv_val != bdn.bv_val ) ) - { + if ( !BER_BVISNULL( &ent.e_name ) ) { + assert( ent.e_name.bv_val != bdn.bv_val ); free( ent.e_name.bv_val ); BER_BVZERO( &ent.e_name ); } diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index 34c23de511..fff12ab215 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -942,8 +942,10 @@ meta_send_entry( rs->sr_entry = NULL; rs->sr_attrs = NULL; - if ( !BER_BVISNULL( &ent.e_name ) && ent.e_name.bv_val != bdn.bv_val ) { - free( ent.e_name.bv_val ); + if ( !BER_BVISNULL( &ent.e_name ) ) { + if ( ent.e_name.bv_val != bdn.bv_val ) { + free( ent.e_name.bv_val ); + } BER_BVZERO( &ent.e_name ); } if ( !BER_BVISNULL( &ent.e_nname ) ) { -- 2.39.5