rbb 01/01/02 16:53:07
Modified: lib apr_pools.c
Log:
We should not be assigning permanent_pool inside of make_sub_pool. This
runs the risk of overwriting permanent_pool, which would be VERY bad. By
moving this back to apr_init_alloc, we know that it should only be called
by apr_initialize. This does mean that we can NEVER call apr_initialize
twice in the same program, but that should already be taken care of.
Revision Changes Path
1.77 +1 -3 apr/lib/apr_pools.c
Index: apr_pools.c
===================================================================
RCS file: /home/cvs/apr/lib/apr_pools.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- apr_pools.c 2001/01/02 01:33:05 1.76
+++ apr_pools.c 2001/01/03 00:53:05 1.77
@@ -493,9 +493,6 @@
}
p->sub_pools = new_pool;
}
- else {
- permanent_pool = new_pool;
- }
#if APR_HAS_THREADS
if (alloc_mutex) {
@@ -691,6 +688,7 @@
return status;
}
#endif
+ permanent_pool = apr_make_sub_pool(pglobal);
#ifdef ALLOC_STATS
atexit(dump_stats);