From 465a50cffc5aeaec812238e8408fe0df9691642f Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 11 Apr 2003 22:30:48 +0000 Subject: [PATCH] fix memory context (hope NULL at init is valid) --- servers/slapd/back-monitor/backend.c | 4 ++-- servers/slapd/back-monitor/compare.c | 3 ++- servers/slapd/back-monitor/database.c | 4 ++-- servers/slapd/back-monitor/listener.c | 4 ++-- servers/slapd/back-monitor/log.c | 16 +++++----------- servers/slapd/back-monitor/rww.c | 2 +- servers/slapd/back-monitor/thread.c | 4 ++-- 7 files changed, 16 insertions(+), 21 deletions(-) diff --git a/servers/slapd/back-monitor/backend.c b/servers/slapd/back-monitor/backend.c index 573eaad4f0..538070a4f5 100644 --- a/servers/slapd/back-monitor/backend.c +++ b/servers/slapd/back-monitor/backend.c @@ -109,8 +109,8 @@ monitor_subsys_backend_init( bv.bv_val = bi->bi_type; bv.bv_len = strlen( bv.bv_val ); - attr_merge_normalize_one( e, monitor_ad_desc, &bv ); - attr_merge_normalize_one( e_backend, monitor_ad_desc, &bv ); + attr_merge_normalize_one( e, monitor_ad_desc, &bv, NULL ); + attr_merge_normalize_one( e_backend, monitor_ad_desc, &bv, NULL ); if ( bi->bi_controls ) { int j; diff --git a/servers/slapd/back-monitor/compare.c b/servers/slapd/back-monitor/compare.c index 4e04e52b44..ef57d9ffbc 100644 --- a/servers/slapd/back-monitor/compare.c +++ b/servers/slapd/back-monitor/compare.c @@ -79,7 +79,8 @@ monitor_back_compare( struct slap_op *op, struct slap_rep *rs) if ( value_find_ex( op->oq_compare.rs_ava->aa_desc, SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH | SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH, - a->a_nvals, &op->oq_compare.rs_ava->aa_value ) == 0 ) + a->a_nvals, &op->oq_compare.rs_ava->aa_value, + op->o_tmpmemctx ) == 0 ) { rs->sr_err = LDAP_COMPARE_TRUE; break; diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index b4ce5de9ae..f21eee7abf 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -152,7 +152,7 @@ monitor_subsys_database_init( j, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_dn.bv_val ); bv.bv_val = buf; bv.bv_len = strlen( buf ); - attr_merge_normalize_one( e, ad_seeAlso, &bv ); + attr_merge_normalize_one( e, ad_seeAlso, &bv, NULL ); break; } } @@ -239,7 +239,7 @@ monitor_back_add_plugin( Backend *be, Entry *e_database ) bv.bv_val = buf; bv.bv_len = strlen( buf ); - attr_merge_normalize_one( e_database, monitor_ad_desc, &bv ); + attr_merge_normalize_one( e_database, monitor_ad_desc, &bv, NULL ); i++; diff --git a/servers/slapd/back-monitor/listener.c b/servers/slapd/back-monitor/listener.c index 2224ec1de7..d25d49d6c1 100644 --- a/servers/slapd/back-monitor/listener.c +++ b/servers/slapd/back-monitor/listener.c @@ -127,7 +127,7 @@ monitor_subsys_listener_init( bv.bv_val = "TLS"; bv.bv_len = sizeof("TLS")-1; - attr_merge_normalize_one( e, monitor_ad_desc, &bv ); + attr_merge_normalize_one( e, monitor_ad_desc, &bv, NULL ); } #endif /* HAVE_TLS */ #ifdef LDAP_CONNECTIONLESS @@ -137,7 +137,7 @@ monitor_subsys_listener_init( bv.bv_val = "UDP"; bv.bv_len = sizeof("UDP")-1; - attr_merge_normalize_one( e, monitor_ad_desc, &bv ); + attr_merge_normalize_one( e, monitor_ad_desc, &bv, NULL ); } #endif /* HAVE_TLS */ diff --git a/servers/slapd/back-monitor/log.c b/servers/slapd/back-monitor/log.c index 5ebcba76fb..12860b5cac 100644 --- a/servers/slapd/back-monitor/log.c +++ b/servers/slapd/back-monitor/log.c @@ -124,7 +124,7 @@ monitor_subsys_log_init( monitor_ad_desc->ad_type->sat_syntax, monitor_ad_desc->ad_type->sat_equality, &int_2_level[ i ].s, - &int_2_level[ i ].n ); + &int_2_level[ i ].n, NULL ); if ( rc ) { return( -1 ); } @@ -348,11 +348,8 @@ add_values( Entry *e, Modification *mod, int *newlevel ) struct berval asserted; rc = asserted_value_validate_normalize( - mod->sm_desc, mr, - SLAP_MR_EQUALITY, - &mod->sm_bvalues[i], - &asserted, - &text ); + mod->sm_desc, mr, SLAP_MR_EQUALITY, + &mod->sm_bvalues[i], &asserted, &text, NULL ); if ( rc != LDAP_SUCCESS ) { return rc; @@ -430,11 +427,8 @@ delete_values( Entry *e, Modification *mod, int *newlevel ) struct berval asserted; rc = asserted_value_validate_normalize( - mod->sm_desc, mr, - SLAP_MR_EQUALITY, - &mod->sm_bvalues[i], - &asserted, - &text ); + mod->sm_desc, mr, SLAP_MR_EQUALITY, + &mod->sm_bvalues[i], &asserted, &text, NULL ); if( rc != LDAP_SUCCESS ) return rc; diff --git a/servers/slapd/back-monitor/rww.c b/servers/slapd/back-monitor/rww.c index cc1a383d1b..108546009d 100644 --- a/servers/slapd/back-monitor/rww.c +++ b/servers/slapd/back-monitor/rww.c @@ -120,7 +120,7 @@ monitor_subsys_readw_update_internal( bv.bv_val = buf; bv.bv_len = strlen( buf ); - attr_merge_normalize_one( e, monitor_ad_desc, &bv ); + attr_merge_normalize_one( e, monitor_ad_desc, &bv, NULL ); } return( 0 ); diff --git a/servers/slapd/back-monitor/thread.c b/servers/slapd/back-monitor/thread.c index 16dd56b129..1008d61db8 100644 --- a/servers/slapd/back-monitor/thread.c +++ b/servers/slapd/back-monitor/thread.c @@ -75,7 +75,7 @@ monitor_subsys_thread_init( bv.bv_val = buf; bv.bv_len = strlen( bv.bv_val ); - attr_merge_normalize_one( e, monitor_ad_desc, &bv ); + attr_merge_normalize_one( e, monitor_ad_desc, &bv, NULL ); monitor_cache_release( mi, e ); @@ -112,7 +112,7 @@ monitor_subsys_thread_update( bv.bv_val = buf; bv.bv_len = strlen( buf ); - attr_merge_normalize_one( e, monitor_ad_desc, &bv ); + attr_merge_normalize_one( e, monitor_ad_desc, &bv, NULL ); } return( 0 ); -- 2.39.5