From: Pierangelo Masarati Date: Sat, 21 May 2005 14:53:05 +0000 (+0000) Subject: fix entry DN free X-Git-Tag: OPENLDAP_AC_BP~620 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=be53e8265065e7de61a0996e37732f44e22fdec7;p=openldap fix entry DN free --- 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 ) ) {