]> granicus.if.org Git - apache/commitdiff
mod_slotmem_shm: follow up tp r1822509.
authorYann Ylavic <ylavic@apache.org>
Tue, 6 Feb 2018 23:37:25 +0000 (23:37 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 6 Feb 2018 23:37:25 +0000 (23:37 +0000)
Do not bind attached slotmems to the global list, they should be detached with
the given pool (pchild) is cleaned up, but not destroyed/removed (doubly) with
pglobal.

[Reverted by r1831868]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1823415 13f79535-47bb-0310-9956-ffa450edef68

modules/slotmem/mod_slotmem_shm.c

index a8d424190a8d8dd2f49f8d79214d5df821213735..64f776868b7f6d561c3892ba31f9c36dbf6cf1c5 100644 (file)
@@ -579,7 +579,7 @@ static apr_status_t slotmem_attach(ap_slotmem_instance_t **new,
     }
 
     /* next try to attach to existing shared memory */
-    rv = apr_shm_attach(&shm, fname, gpool);
+    rv = apr_shm_attach(&shm, fname, pool);
     if (rv != APR_SUCCESS) {
         return rv;
     }
@@ -589,8 +589,8 @@ static apr_status_t slotmem_attach(ap_slotmem_instance_t **new,
     ptr = (char *)desc + AP_SLOTMEM_OFFSET;
 
     /* For the chained slotmem stuff */
-    res = apr_pcalloc(gpool, sizeof(ap_slotmem_instance_t));
-    res->name = apr_pstrdup(gpool, fname);
+    res = apr_pcalloc(pool, sizeof(ap_slotmem_instance_t));
+    res->name = apr_pstrdup(pool, fname);
     res->fbased = 1;
     res->shm = shm;
     res->persist = (void *)ptr;
@@ -601,12 +601,6 @@ static apr_status_t slotmem_attach(ap_slotmem_instance_t **new,
     res->pool = pool;
     res->inuse = ptr + (desc->size * desc->num);
     res->next = NULL;
-    if (globallistmem == NULL) {
-        globallistmem = res;
-    }
-    else {
-        next->next = res;
-    }
 
     *new = res;
     *item_size = desc->size;