From: Ondřej Kuzník Date: Thu, 15 Sep 2022 08:15:55 +0000 (+0100) Subject: ITS#9907 Some tools consider abandoned global data a leak X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=034225ff5cf6b80e9c02e95c3f39eb0513d63555;p=thirdparty%2Fopenldap.git ITS#9907 Some tools consider abandoned global data a leak --- diff --git a/servers/lloadd/config.c b/servers/lloadd/config.c index 377d7dac64..530b037dc9 100644 --- a/servers/lloadd/config.c +++ b/servers/lloadd/config.c @@ -1389,8 +1389,8 @@ static struct { { NULL } }; -static void -restriction_free( struct restriction_entry *restriction ) +void +lload_restriction_free( struct restriction_entry *restriction ) { ch_free( restriction->oid.bv_val ); ch_free( restriction ); @@ -1428,7 +1428,7 @@ config_restrict_oid( ConfigArgs *c ) } else if ( c->op == LDAP_MOD_DELETE ) { if ( !c->line ) { - ldap_tavl_free( *root, (AVL_FREE)restriction_free ); + ldap_tavl_free( *root, (AVL_FREE)lload_restriction_free ); *root = NULL; if ( c->type == CFG_RESTRICT_EXOP ) { lload_default_exop_action = LLOAD_OP_NOT_RESTRICTED; diff --git a/servers/lloadd/init.c b/servers/lloadd/init.c index 72e0536d23..1809557099 100644 --- a/servers/lloadd/init.c +++ b/servers/lloadd/init.c @@ -114,6 +114,8 @@ lload_global_destroy( void ) } lload_exop_destroy(); + ldap_tavl_free( lload_control_actions, (AVL_FREE)lload_restriction_free ); + ldap_tavl_free( lload_exop_actions, (AVL_FREE)lload_restriction_free ); #ifdef HAVE_TLS if ( lload_tls_backend_ld ) { diff --git a/servers/lloadd/proto-lload.h b/servers/lloadd/proto-lload.h index f69111e178..cfbbd9546a 100644 --- a/servers/lloadd/proto-lload.h +++ b/servers/lloadd/proto-lload.h @@ -81,6 +81,7 @@ LDAP_SLAPD_F (int) lload_bindconf_parse( const char *word, slap_bindconf *bc ); LDAP_SLAPD_F (int) lload_bindconf_unparse( slap_bindconf *bc, struct berval *bv ); LDAP_SLAPD_F (int) lload_bindconf_tls_set( slap_bindconf *bc, LDAP *ld ); LDAP_SLAPD_F (void) lload_bindconf_free( slap_bindconf *bc ); +LDAP_SLAPD_F (void) lload_restriction_free( struct restriction_entry *entry ); #ifdef BALANCER_MODULE LDAP_SLAPD_F (int) lload_back_init_cf( BackendInfo *bi ); #endif