apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r1823145 - /apr/apr-util/branches/1.7.x/buckets/apr_buckets_alloc.c
Date Mon, 05 Feb 2018 09:43:55 GMT
Author: rpluem
Date: Mon Feb  5 09:43:55 2018
New Revision: 1823145

URL: http://svn.apache.org/viewvc?rev=1823145&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.7.x/buckets/apr_buckets_alloc.c

Modified: apr/apr-util/branches/1.7.x/buckets/apr_buckets_alloc.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/buckets/apr_buckets_alloc.c?rev=1823145&r1=1823144&r2=1823145&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/buckets/apr_buckets_alloc.c (original)
+++ apr/apr-util/branches/1.7.x/buckets/apr_buckets_alloc.c Mon Feb  5 09:43:55 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