From: Jim Jagielski Date: Thu, 31 Mar 2011 15:12:13 +0000 (+0000) Subject: Don't kill me mister... X-Git-Tag: 2.3.12~125 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6967cb6930ac6356e8bd82ab6a9bf88506f060a0;p=thirdparty%2Fapache%2Fhttpd.git Don't kill me mister... git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1087333 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/slotmem/mod_slotmem_shm.c b/modules/slotmem/mod_slotmem_shm.c index c696a962377..8b5edad33ef 100644 --- a/modules/slotmem/mod_slotmem_shm.c +++ b/modules/slotmem/mod_slotmem_shm.c @@ -207,7 +207,6 @@ static apr_status_t cleanup_slotmem(void *param) if (*mem) { ap_slotmem_instance_t *next = *mem; - apr_pool_t *p = next->gpool; while (next) { if (AP_SLOTMEM_IS_PERSIST(next)) { store_slotmem(next); @@ -215,11 +214,6 @@ static apr_status_t cleanup_slotmem(void *param) apr_shm_destroy((apr_shm_t *)next->shm); next = next->next; } - apr_pool_destroy(p); - } else { - /* If shared mem was never called, then just remove - * the global pool */ - apr_pool_destroy(gpool); } return APR_SUCCESS; } @@ -572,7 +566,7 @@ static apr_status_t slotmem_grab(ap_slotmem_instance_t *slot, unsigned int *id) } } if (i >= slot->desc.num) { - return APR_ENOSHMAVAIL; + return APR_EINVAL; } *inuse = 1; *id = i; @@ -623,7 +617,9 @@ static const ap_slotmem_provider_t *slotmem_shm_getstorage(void) /* initialise the global pool */ static void slotmem_shm_initgpool(apr_pool_t *p) { - gpool = p; + if (!gpool && p) { + gpool = p; + } } /* Add the pool_clean routine */