From e0ff8d67820e7d5c0aa4174f7e92370589317778 Mon Sep 17 00:00:00 2001 From: Mark Adamson Date: Mon, 5 Nov 2001 23:14:42 +0000 Subject: [PATCH] fix various memory leaks --- libraries/libldap_r/thr_posix.c | 1 + servers/slapd/root_dse.c | 1 + servers/slapd/sasl.c | 4 ++++ servers/slapd/schema_init.c | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/libraries/libldap_r/thr_posix.c b/libraries/libldap_r/thr_posix.c index 07e1e8f6ea..4c322cf4b3 100644 --- a/libraries/libldap_r/thr_posix.c +++ b/libraries/libldap_r/thr_posix.c @@ -113,6 +113,7 @@ ldap_pvt_thread_create( ldap_pvt_thread_t * thread, (void) pthread_detach( *thread ); } #endif + pthread_attr_destroy(&attr); #else rtn = pthread_create( thread, LDAP_INT_THREAD_ATTR_DEFAULT, diff --git a/servers/slapd/root_dse.c b/servers/slapd/root_dse.c index 19c6291015..68166471f8 100644 --- a/servers/slapd/root_dse.c +++ b/servers/slapd/root_dse.c @@ -120,6 +120,7 @@ root_dse_info( val.bv_len = strlen( val.bv_val ); attr_merge( e, ad_supportedSASLMechanisms, vals ); } + charray_free( supportedSASLMechanisms ); } if ( default_referral != NULL ) { diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index e41c28d2bf..f2907b47db 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -713,6 +713,10 @@ int slap_sasl_bind( NULL, errstr, NULL, NULL ); } + if( response.bv_len ) { + ch_free( response.bv_val ); + } + #ifdef NEW_LOGGING LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, "slap_sasl_bind: rc=%d\n", rc )); diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index e88a9fe368..cfb9494b07 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -1550,6 +1550,10 @@ int caseExactIgnoreSubstringsFilter( } if( nkeys == 0 ) { + ch_free( sa->sa_final ); + ber_bvecfree( sa->sa_any ); + ch_free( sa->sa_initial ); + ch_free( sa ); *keysp = NULL; return LDAP_SUCCESS; } -- 2.39.5