diff options
author | rjung <rjung@13f79535-47bb-0310-9956-ffa450edef68> | 2019-07-17 11:42:15 +0000 |
---|---|---|
committer | rjung <rjung@13f79535-47bb-0310-9956-ffa450edef68> | 2019-07-17 11:42:15 +0000 |
commit | 814cf6b6b2eb87333647aca8837d2672958bb223 (patch) | |
tree | daff5fa25ce6e344706fb083e345c380ec0e9b4e | |
parent | 568bbacf17a0c7929abf548b368f4bcb8be10faf (diff) | |
download | libapr-814cf6b6b2eb87333647aca8837d2672958bb223.tar.gz |
Pool debugging fixes
- avoid using a destroyed mutex in apr_pool_clear()
- if we create a sub-pool, we don't need to own the pool.
Backport of r1481186 from trunk resp. r1863200 from 1.7.x.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1863209 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | memory/unix/apr_pools.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 614919ede..cd6b17811 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1909,6 +1909,11 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, * the mutex we obtained above. */ if (mutex != pool->mutex) { + /* + * Prevent apr_palloc() in apr_thread_mutex_create() from trying to + * use the destroyed mutex. + */ + pool->mutex = NULL; (void)apr_thread_mutex_create(&pool->mutex, APR_THREAD_MUTEX_NESTED, pool); @@ -1985,7 +1990,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, parent = global_pool; } else { - apr_pool_check_integrity(parent); + apr_pool_check_lifetime(parent); if (!allocator) allocator = parent->allocator; |