From cb3248f173c03bad9bef639105b44aa05f8e8262 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 1 Sep 2006 10:01:36 +0000 Subject: [PATCH] cleanup --- libraries/libldap/request.c | 6 +++++- servers/slapd/attr.c | 3 +-- servers/slapd/back-monitor/conn.c | 16 ++++++++++------ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index 2b9060d9d7..c140dc73b9 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -420,6 +420,7 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc **srvlist, int use_ldsb, } ldap_free_urldesc( srvfunc ); } + } else { int msgid, rc; struct berval passwd = BER_BVNULL; @@ -599,7 +600,10 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ) } #endif - /* FIXME: is this at all possible? */ + /* FIXME: is this at all possible? + * ldap_ld_free() in unbind.c calls ldap_free_connection() + * with force == 1 __after__ explicitly calling + * ldap_free_request() on all requests */ if ( force ) { LDAPRequest *lr; diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index 36878d2398..78784736b2 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -78,8 +78,7 @@ Attribute * attr_alloc( AttributeDescription *ad ) { Attribute *a; - - + ldap_pvt_thread_mutex_lock( &attr_mutex ); if ( !attr_list ) attr_prealloc( CHUNK_SIZE ); diff --git a/servers/slapd/back-monitor/conn.c b/servers/slapd/back-monitor/conn.c index a35036237c..24e8cc4e5c 100644 --- a/servers/slapd/back-monitor/conn.c +++ b/servers/slapd/back-monitor/conn.c @@ -181,7 +181,8 @@ monitor_subsys_conn_update( for ( n = 0, c = connection_first( &connindex ); c != NULL; - n++, c = connection_next( c, &connindex ) ) { + n++, c = connection_next( c, &connindex ) ) + { /* No Op */ ; } connection_done( c ); @@ -426,9 +427,6 @@ monitor_subsys_conn_create( { monitor_info_t *mi = ( monitor_info_t * )op->o_bd->be_private; - Connection *c; - int connindex; - monitor_entry_t *mp; int rc = SLAP_CB_CONTINUE; monitor_subsys_t *ms; @@ -441,14 +439,18 @@ monitor_subsys_conn_create( *ep = NULL; if ( ndn == NULL ) { - Entry *e = NULL, - *e_tmp = NULL; + Connection *c; + int connindex; + Entry *e = NULL, + *e_tmp = NULL; /* create all the children of e_parent */ for ( c = connection_first( &connindex ); c != NULL; c = connection_next( c, &connindex ) ) { + monitor_entry_t *mp; + if ( conn_create( mi, c, &e, ms ) != SLAP_CB_CONTINUE || e == NULL ) { @@ -473,6 +475,8 @@ monitor_subsys_conn_create( *ep = e; } else { + Connection *c; + int connindex; unsigned long connid; char *next = NULL; static struct berval nconn_bv = BER_BVC( "cn=connection " ); -- 2.39.5