You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by rp...@apache.org on 2018/02/05 09:44:16 UTC
svn commit: r1823146 -
/apr/apr-util/branches/1.6.x/buckets/apr_buckets_alloc.c
Author: rpluem
Date: Mon Feb 5 09:44:16 2018
New Revision: 1823146
URL: http://svn.apache.org/viewvc?rev=1823146&view=rev
Log:
Merge r1822315 from trunk:
* We cannot access list any longer after we called apr_allocator_free as it points to memory we just freed.
Reviewed by: rpluem
Modified:
apr/apr-util/branches/1.6.x/buckets/apr_buckets_alloc.c
Modified: apr/apr-util/branches/1.6.x/buckets/apr_buckets_alloc.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.6.x/buckets/apr_buckets_alloc.c?rev=1823146&r1=1823145&r2=1823146&view=diff
==============================================================================
--- apr/apr-util/branches/1.6.x/buckets/apr_buckets_alloc.c (original)
+++ apr/apr-util/branches/1.6.x/buckets/apr_buckets_alloc.c Mon Feb 5 09:44:16 2018
@@ -45,12 +45,21 @@ struct apr_bucket_alloc_t {
static apr_status_t alloc_cleanup(void *data)
{
apr_bucket_alloc_t *list = data;
+#if APR_POOL_DEBUG
+ apr_allocator_t *allocator = NULL;
+#endif
+
+#if APR_POOL_DEBUG
+ if (list->pool && list->allocator != apr_pool_allocator_get(list->pool)) {
+ allocator = list->allocator;
+ }
+#endif
apr_allocator_free(list->allocator, list->blocks);
#if APR_POOL_DEBUG
- if (list->pool && list->allocator != apr_pool_allocator_get(list->pool)) {
- apr_allocator_destroy(list->allocator);
+ if (allocator) {
+ apr_allocator_destroy(allocator);
}
#endif