From da33fd570880c4cc90465b96936b2bb40af4b632 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Tue, 16 Jul 2019 20:38:18 +0000 Subject: [PATCH] Fix crashes when running with debug APR (APR_POOL_DEBUG), because all pools have NULL allocators then. This workaround is probably not very efficient, but is only used when we do APR_POOL_DEBUG and efficiency shouldn't be a big concern then. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1863179 13f79535-47bb-0310-9956-ffa450edef68 --- server/util.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/util.c b/server/util.c index b5633475436..044b073bf58 100644 --- a/server/util.c +++ b/server/util.c @@ -2994,6 +2994,11 @@ AP_DECLARE(void) ap_varbuf_grow(struct ap_varbuf *vb, apr_size_t new_len) /* The required block is rather larger. Use allocator directly so that * the memory can be freed independently from the pool. */ allocator = apr_pool_allocator_get(vb->pool); + /* Happens if APR was compiled with APR_POOL_DEBUG */ + if (allocator == NULL) { + apr_allocator_create(&allocator); + ap_assert(allocator != NULL); + } if (new_len <= VARBUF_MAX_SIZE) new_node = apr_allocator_alloc(allocator, new_len + APR_ALIGN_DEFAULT(sizeof(*new_info))); -- 2.47.3