From: Bradley Nicholes Date: Sat, 30 Oct 2004 04:49:58 +0000 (+0000) Subject: Don't display the cache statistics if the node is empty X-Git-Tag: 2.1.1~89 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ace27ccb1aa7c173c062ae66d6fa501e6274066;p=apache Don't display the cache statistics if the node is empty git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105629 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/ldap/util_ldap_cache_mgr.c b/modules/ldap/util_ldap_cache_mgr.c index f9a74429c4..ab35ad35da 100644 --- a/modules/ldap/util_ldap_cache_mgr.c +++ b/modules/ldap/util_ldap_cache_mgr.c @@ -645,10 +645,12 @@ char *util_ald_cache_display(request_rec *r, util_ldap_state_t *st) "Last Bind" "\n", r ); - for (i=0; i < n->search_cache->size; ++i) { - for (p = n->search_cache->nodes[i]; p != NULL; p = p->next) { - - (*n->search_cache->display)(r, n->search_cache, p->payload); + if (n) { + for (i=0; i < n->search_cache->size; ++i) { + for (p = n->search_cache->nodes[i]; p != NULL; p = p->next) { + + (*n->search_cache->display)(r, n->search_cache, p->payload); + } } } ap_rputs("\n

\n", r); @@ -664,10 +666,12 @@ char *util_ald_cache_display(request_rec *r, util_ldap_state_t *st) "Result" "\n", r ); - for (i=0; i < n->compare_cache->size; ++i) { - for (p = n->compare_cache->nodes[i]; p != NULL; p = p->next) { - - (*n->compare_cache->display)(r, n->compare_cache, p->payload); + if (n) { + for (i=0; i < n->compare_cache->size; ++i) { + for (p = n->compare_cache->nodes[i]; p != NULL; p = p->next) { + + (*n->compare_cache->display)(r, n->compare_cache, p->payload); + } } } ap_rputs("\n

\n", r); @@ -680,10 +684,12 @@ char *util_ald_cache_display(request_rec *r, util_ldap_state_t *st) "Actual DN" "\n", r ); - for (i=0; i < n->dn_compare_cache->size; ++i) { - for (p = n->dn_compare_cache->nodes[i]; p != NULL; p = p->next) { - - (*n->dn_compare_cache->display)(r, n->dn_compare_cache, p->payload); + if (n) { + for (i=0; i < n->dn_compare_cache->size; ++i) { + for (p = n->dn_compare_cache->nodes[i]; p != NULL; p = p->next) { + + (*n->dn_compare_cache->display)(r, n->dn_compare_cache, p->payload); + } } } ap_rputs("\n

\n", r);