summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2001-01-02 01:33:05 +0000
committerrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2001-01-02 01:33:05 +0000
commit75357f27197f4a59c6412064761c709492a41312 (patch)
tree5c4815732b0b4f19c6871eab137ab1a5f616819f
parent2366f03c8a0656d7afda3863b1e2636fe8dadd36 (diff)
downloadlibapr-75357f27197f4a59c6412064761c709492a41312.tar.gz
Remove the ability to allocate out of a NULL pool. This was always a bad
idea, because it opened up memory leaks. It is very likely that this will expose some seg faults and some memory leaks, but I have tried to find and fix most of the already. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61002 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES3
-rw-r--r--lib/apr_pools.c6
-rw-r--r--memory/unix/apr_pools.c6
3 files changed, 3 insertions, 12 deletions
diff --git a/CHANGES b/CHANGES
index 2368bfe4f..c28bcc21f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
Changes with APR b1
+ *) Remove the ability to allocate memory out of a NULL pool.
+ [Ryan Bloom]
+
*) Add an APR_GET_POOL macro to get a pool from any APR type that has
a pool. This requires that ALL apr types put the pool as the first
field in their structure. [Ryan Bloom]
diff --git a/lib/apr_pools.c b/lib/apr_pools.c
index 867842d6a..4bc5977b7 100644
--- a/lib/apr_pools.c
+++ b/lib/apr_pools.c
@@ -940,12 +940,6 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize)
nclicks = 1 + ((reqsize - 1) / CLICK_SZ);
size = nclicks * CLICK_SZ;
-
- if (a == NULL) {
- return malloc(reqsize);
- }
-
-
/* First, see if we have space in the block most recently
* allocated to this pool
*/
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
index 867842d6a..4bc5977b7 100644
--- a/memory/unix/apr_pools.c
+++ b/memory/unix/apr_pools.c
@@ -940,12 +940,6 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize)
nclicks = 1 + ((reqsize - 1) / CLICK_SZ);
size = nclicks * CLICK_SZ;
-
- if (a == NULL) {
- return malloc(reqsize);
- }
-
-
/* First, see if we have space in the block most recently
* allocated to this pool
*/