svn commit: r1935313 - apr/apr/trunk/memory/unix

[email protected] Sun, 14 Jun 2026 16:23:40 -0000
Newsgroups gmane.comp.apache.apr.cvs
Message-ID <178145422010.1793987.9940064797390599268@svn03-he-fi>
Author: brane
Date: Sun Jun 14 16:23:39 2026
New Revision: 1935313

Log:
Follow up to r1935301: Don't forget to set the owner of the new unmanaged pool's allocator.

Modified:
   apr/apr/trunk/memory/unix/apr_pools.c

Modified: apr/apr/trunk/memory/unix/apr_pools.c
==============================================================================
--- apr/apr/trunk/memory/unix/apr_pools.c	Sun Jun 14 16:14:26 2026	(r1935312)
+++ apr/apr/trunk/memory/unix/apr_pools.c	Sun Jun 14 16:23:39 2026	(r1935313)
@@ -1125,24 +1125,29 @@ static apr_status_t create_pool(apr_pool
     pool->user_data = NULL;
     pool->tag = NULL;
 
-    if ((pool->parent = parent) != NULL) {
-        allocator_lock(parent->allocator);
+    if (create_unmanaged_pool) {
+        if (need_new_allocator)
+            allocator->owner = pool;
+    }
+    else {
+        if ((pool->parent = parent) != NULL) {
+            allocator_lock(parent->allocator);
 
-        if ((pool->sibling = parent->child) != NULL)
-            pool->sibling->ref = &pool->sibling;
+            if ((pool->sibling = parent->child) != NULL)
+                pool->sibling->ref = &pool->sibling;
 
-        parent->child = pool;
-        pool->ref = &parent->child;
+            parent->child = pool;
+            pool->ref = &parent->child;
 
-        allocator_unlock(parent->allocator);
-    }
-    else {
-        pool->sibling = NULL;
-        pool->ref = NULL;
+            allocator_unlock(parent->allocator);
+        }
+        else {
+            pool->sibling = NULL;
+            pool->ref = NULL;
+        }
     }
 
     pool_concurrency_init(pool);
-
     *newpool = pool;
 
     return APR_SUCCESS;