From dfc538ce4eec42e431f50556fe10651514489866 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 6 Feb 2018 23:37:25 +0000 Subject: [PATCH] mod_slotmem_shm: follow up tp r1822509. 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 | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/modules/slotmem/mod_slotmem_shm.c b/modules/slotmem/mod_slotmem_shm.c index a8d424190a..64f776868b 100644 --- a/modules/slotmem/mod_slotmem_shm.c +++ b/modules/slotmem/mod_slotmem_shm.c @@ -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; -- 2.40.0