From 2047a0d784e59ed78a83ae8e70536a822feda338 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 18 Dec 2009 19:07:16 +0000 Subject: [PATCH] plug one-time leaks --- servers/slapd/back-ldap/init.c | 49 ++++------------------------------ servers/slapd/config.c | 3 +++ 2 files changed, 8 insertions(+), 44 deletions(-) diff --git a/servers/slapd/back-ldap/init.c b/servers/slapd/back-ldap/init.c index 3d0cc728f1..4f558653cc 100644 --- a/servers/slapd/back-ldap/init.c +++ b/servers/slapd/back-ldap/init.c @@ -298,50 +298,11 @@ ldap_back_db_destroy( Backend *be, ConfigReply *cr ) ber_bvarray_free( li->li_bvuri ); li->li_bvuri = NULL; } - if ( !BER_BVISNULL( &li->li_acl_authcID ) ) { - ch_free( li->li_acl_authcID.bv_val ); - BER_BVZERO( &li->li_acl_authcID ); - } - if ( !BER_BVISNULL( &li->li_acl_authcDN ) ) { - ch_free( li->li_acl_authcDN.bv_val ); - BER_BVZERO( &li->li_acl_authcDN ); - } - if ( !BER_BVISNULL( &li->li_acl_passwd ) ) { - ch_free( li->li_acl_passwd.bv_val ); - BER_BVZERO( &li->li_acl_passwd ); - } - if ( !BER_BVISNULL( &li->li_acl_sasl_mech ) ) { - ch_free( li->li_acl_sasl_mech.bv_val ); - BER_BVZERO( &li->li_acl_sasl_mech ); - } - if ( !BER_BVISNULL( &li->li_acl_sasl_realm ) ) { - ch_free( li->li_acl_sasl_realm.bv_val ); - BER_BVZERO( &li->li_acl_sasl_realm ); - } - if ( !BER_BVISNULL( &li->li_idassert_authcID ) ) { - ch_free( li->li_idassert_authcID.bv_val ); - BER_BVZERO( &li->li_idassert_authcID ); - } - if ( !BER_BVISNULL( &li->li_idassert_authcDN ) ) { - ch_free( li->li_idassert_authcDN.bv_val ); - BER_BVZERO( &li->li_idassert_authcDN ); - } - if ( !BER_BVISNULL( &li->li_idassert_passwd ) ) { - ch_free( li->li_idassert_passwd.bv_val ); - BER_BVZERO( &li->li_idassert_passwd ); - } - if ( !BER_BVISNULL( &li->li_idassert_authzID ) ) { - ch_free( li->li_idassert_authzID.bv_val ); - BER_BVZERO( &li->li_idassert_authzID ); - } - if ( !BER_BVISNULL( &li->li_idassert_sasl_mech ) ) { - ch_free( li->li_idassert_sasl_mech.bv_val ); - BER_BVZERO( &li->li_idassert_sasl_mech ); - } - if ( !BER_BVISNULL( &li->li_idassert_sasl_realm ) ) { - ch_free( li->li_idassert_sasl_realm.bv_val ); - BER_BVZERO( &li->li_idassert_sasl_realm ); - } + + bindconf_free( &li->li_tls ); + bindconf_free( &li->li_acl ); + bindconf_free( &li->li_idassert.si_bc ); + if ( li->li_idassert_authz != NULL ) { ber_bvarray_free( li->li_idassert_authz ); li->li_idassert_authz = NULL; diff --git a/servers/slapd/config.c b/servers/slapd/config.c index 1d44f94a79..55de738df3 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -1288,6 +1288,9 @@ slap_keepalive_parse( } *sk = sk2; + + ber_memfree( val->bv_val ); + BER_BVZERO( val ); } return 0; -- 2.39.5