From c41a151d1e6964f48c97c4284cbd3fe9588fee5e Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 31 Mar 2006 12:53:32 +0000 Subject: [PATCH] Cleanup --- servers/slapd/back-bdb/id2entry.c | 5 ++--- servers/slapd/component.c | 2 +- servers/slapd/connection.c | 4 ++-- servers/slapd/repl.c | 2 +- servers/slapd/value.c | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/servers/slapd/back-bdb/id2entry.c b/servers/slapd/back-bdb/id2entry.c index f362739185..869c217aad 100644 --- a/servers/slapd/back-bdb/id2entry.c +++ b/servers/slapd/back-bdb/id2entry.c @@ -258,9 +258,8 @@ int bdb_entry_release( #endif } /* free entry and reader or writer lock */ - if ( op ) { - boi = (struct bdb_op_info *)op->o_private; - } + boi = (struct bdb_op_info *)op->o_private; + /* lock is freed with txn */ if ( !boi || boi->boi_txn ) { bdb_unlocked_cache_return_entry_rw( &bdb->bi_cache, e, rw ); diff --git a/servers/slapd/component.c b/servers/slapd/component.c index 67693a61ac..3a6ae67d89 100644 --- a/servers/slapd/component.c +++ b/servers/slapd/component.c @@ -179,7 +179,7 @@ dup_comp_ref ( Operation* op, ComponentReference* cr ) ci_curr = ci_curr->ci_next, ci_temp = &(*ci_temp)->ci_next ) { *ci_temp = op->o_tmpalloc( sizeof( ComponentId ), op->o_tmpmemctx ); - if ( !ci_temp ) return NULL; + if ( !*ci_temp ) return NULL; **ci_temp = *ci_curr; } diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index be3fca041b..b0b5ab2ba0 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -437,8 +437,6 @@ static Connection* connection_get( ber_socket_t s ) assert( MCA_conn_check( s ) ); c = MCA_GET_CONNECTION(s); - assert( c->c_struct_state != SLAP_C_UNINITIALIZED ); - #else c = NULL; { @@ -475,6 +473,8 @@ static Connection* connection_get( ber_socket_t s ) if( c != NULL ) { ber_socket_t sd; + assert( c->c_struct_state != SLAP_C_UNINITIALIZED ); + ldap_pvt_thread_mutex_lock( &c->c_mutex ); ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_GET_FD, &sd ); diff --git a/servers/slapd/repl.c b/servers/slapd/repl.c index 270f9a11f3..ebdf6267b8 100644 --- a/servers/slapd/repl.c +++ b/servers/slapd/repl.c @@ -398,7 +398,7 @@ replog1( fprintf( fp, "%s: %s\n", did, type ); first = 0; } - vals[0] = a->a_nvals[i]; + vals[0] = ml->sml_values[i]; print_vals( fp, &ml->sml_desc->ad_cname, vals ); ocs = 2; } diff --git a/servers/slapd/value.c b/servers/slapd/value.c index 4afb5e6401..83aab3e42a 100644 --- a/servers/slapd/value.c +++ b/servers/slapd/value.c @@ -236,7 +236,7 @@ int value_find_ex( { rc = (mr->smr_normalize)( flags & (SLAP_MR_TYPE_MASK|SLAP_MR_SUBTYPE_MASK|SLAP_MR_VALUE_OF_SYNTAX), - ad ? ad->ad_type->sat_syntax : NULL, + ad->ad_type->sat_syntax, mr, val, &nval, ctx ); if( rc != LDAP_SUCCESS ) { -- 2.39.5