1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-05 16:55:50 +03:00

Fix a segfault in the LDAP cache purge.

PR:
Obtained from:
Submitted by:	Jess Holle <jessh ptc.com>
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105206 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Graham Leggett
2004-09-19 23:00:25 +00:00
parent c9f2bc9ea6
commit f95b63e596
2 changed files with 10 additions and 4 deletions

View File

@@ -173,7 +173,7 @@ unsigned long util_ald_hash_string(int nstr, ...)
void util_ald_cache_purge(util_ald_cache_t *cache)
{
unsigned long i;
util_cache_node_t *p, *q;
util_cache_node_t *p, *q, **pp;
apr_time_t t;
if (!cache)
@@ -184,7 +184,8 @@ void util_ald_cache_purge(util_ald_cache_t *cache)
cache->numpurges++;
for (i=0; i < cache->size; ++i) {
p = cache->nodes[i];
pp = cache->nodes + i;
p = *pp;
while (p != NULL) {
if (p->add_time < cache->marktime) {
q = p->next;
@@ -192,10 +193,11 @@ void util_ald_cache_purge(util_ald_cache_t *cache)
util_ald_free(cache, p);
cache->numentries--;
cache->npurged++;
p = q;
p = *pp = q;
}
else {
p = p->next;
pp = &(p->next);
p = *pp;
}
}
}
@@ -252,6 +254,8 @@ util_url_node_t *util_ald_create_caches(util_ldap_state_t *st, const char *url)
newcurl = util_ald_cache_insert(st->util_ldap_cache, &curl);
}
else
newcurl = NULL;
return newcurl;
}