summaryrefslogtreecommitdiff
path: root/memory/unix
diff options
context:
space:
mode:
authorStefan Fritsch <sf@apache.org>2013-05-03 19:22:11 +0000
committerStefan Fritsch <sf@apache.org>2013-05-03 19:22:11 +0000
commitd8e09dd83d17d09917cdb045d9cf579d74b4c8e0 (patch)
tree5a5f5bf07684e1c52852a372b30e039f96738158 /memory/unix
parentf29f5b94850abdcbadfd69fee8fa23acc52caf7b (diff)
downloadapr-d8e09dd83d17d09917cdb045d9cf579d74b4c8e0.tar.gz
Fix invalid free when destroying pools created with
apr_pool_create_unmanaged_ex() PR: 54892 Submitted by: Valeriy V. Argunov <hzdbyte gmail com> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1478934 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'memory/unix')
-rw-r--r--memory/unix/apr_pools.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
index 846a9adf1..871e9fc23 100644
--- a/memory/unix/apr_pools.c
+++ b/memory/unix/apr_pools.c
@@ -1003,21 +1003,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool,
if (!apr_pools_initialized)
return APR_ENOPOOL;
if ((pool_allocator = allocator) == NULL) {
-#if !APR_ALLOCATOR_USES_MMAP
- if ((pool_allocator = malloc(MIN_ALLOC)) == NULL) {
- if (abort_fn)
- abort_fn(APR_ENOMEM);
-
- return APR_ENOMEM;
- }
- memset(pool_allocator, 0, SIZEOF_ALLOCATOR_T);
- pool_allocator->max_free_index = APR_ALLOCATOR_MAX_FREE_UNLIMITED;
- node = (apr_memnode_t *)((char *)pool_allocator + SIZEOF_ALLOCATOR_T);
- node->next = NULL;
- node->index = 1;
- node->first_avail = (char *)node + APR_MEMNODE_T_SIZE;
- node->endp = (char *)pool_allocator + MIN_ALLOC;
-#else
if (apr_allocator_create(&pool_allocator) != APR_SUCCESS) {
if (abort_fn)
abort_fn(APR_ENOMEM);
@@ -1031,7 +1016,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool,
return APR_ENOMEM;
}
-#endif
}
else if ((node = allocator_alloc(pool_allocator,
MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) {