From 4ceeea4efa48643587d5dec944e4b8fb1a77e490 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 21 Jul 2005 19:14:09 +0000 Subject: [PATCH] should fix the invalid free issue --- servers/slapd/connection.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 2ac706c6ce..56c02c2f7a 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -598,21 +598,21 @@ void connection2anonymous( Connection *c ) ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_SET_MAX_INCOMING, &max ); } - if(c->c_authmech.bv_val != NULL ) { + if ( !BER_BVISNULL( &c->c_authmech ) ) { ch_free(c->c_authmech.bv_val); } BER_BVZERO( &c->c_authmech ); - if(c->c_dn.bv_val != NULL) { + if ( !BER_BVISNULL( &c->c_dn ) ) { ch_free(c->c_dn.bv_val); } BER_BVZERO( &c->c_dn ); - if(c->c_ndn.bv_val != NULL) { + if ( !BER_BVISNULL( &c->c_ndn ) ) { ch_free(c->c_ndn.bv_val); } BER_BVZERO( &c->c_ndn ); - if(c->c_sasl_authz_dn.bv_val != NULL) { - ch_free(c->c_sasl_authz_dn.bv_val); + if ( !BER_BVISNULL( &c->c_sasl_authz_dn ) ) { + ber_memfree_x( c->c_sasl_authz_dn.bv_val, NULL ); } BER_BVZERO( &c->c_sasl_authz_dn ); -- 2.39.5