apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r1822315 - /apr/apr/trunk/buckets/apr_buckets_alloc.c
Date Fri, 26 Jan 2018 15:24:40 GMT
Author: rpluem
Date: Fri Jan 26 15:24:40 2018
New Revision: 1822315

URL: http://svn.apache.org/viewvc?rev=1822315&view=rev
Log:
* We cannot access list any longer after we called apr_allocator_free as it points to memory
we just freed.

Modified:
    apr/apr/trunk/buckets/apr_buckets_alloc.c

Modified: apr/apr/trunk/buckets/apr_buckets_alloc.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/buckets/apr_buckets_alloc.c?rev=1822315&r1=1822314&r2=1822315&view=diff
==============================================================================
--- apr/apr/trunk/buckets/apr_buckets_alloc.c (original)
+++ apr/apr/trunk/buckets/apr_buckets_alloc.c Fri Jan 26 15:24:40 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
 



Mime
View raw message