From: Ian Holsman Date: Tue, 12 Feb 2002 22:54:16 +0000 (+0000) Subject: once more with feeling X-Git-Tag: 2.0.33~290 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a04f6402b22a0ab329c652eb707d902d89fea036;p=apache once more with feeling obj was set before the mutex so someone could have came and updated h->cache_obj between us setting obj, and useing it. running now for 10 minutes without core (a record!) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93379 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/experimental/mod_mem_cache.c b/modules/experimental/mod_mem_cache.c index f3401754ba..62bf703706 100644 --- a/modules/experimental/mod_mem_cache.c +++ b/modules/experimental/mod_mem_cache.c @@ -346,7 +346,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *type, cons static int remove_entity(cache_handle_t *h) { - cache_object_t *obj = h->cache_obj; + cache_object_t *obj ; if (sconf->lock) { apr_thread_mutex_lock(sconf->lock); @@ -355,7 +355,8 @@ static int remove_entity(cache_handle_t *h) * RACE .. some one might have just deleted this object .. so test * if it is still around */ - if (obj) { + if (h->cache_obj) { + obj = h->cache_obj; apr_hash_set(sconf->cacheht, obj->key, strlen(obj->key), NULL); cleanup_cache_object(obj); h->cache_obj = NULL;