]> granicus.if.org Git - apache/commitdiff
once more with feeling
authorIan Holsman <ianh@apache.org>
Tue, 12 Feb 2002 22:54:16 +0000 (22:54 +0000)
committerIan Holsman <ianh@apache.org>
Tue, 12 Feb 2002 22:54:16 +0000 (22:54 +0000)
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

modules/experimental/mod_mem_cache.c

index f3401754ba2355001de7155c78affb621ff86264..62bf70370652460ab4b1c4ae8ae591f889707edb 100644 (file)
@@ -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;