summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjwoolley <jwoolley@13f79535-47bb-0310-9956-ffa450edef68>2001-03-01 04:59:07 +0000
committerjwoolley <jwoolley@13f79535-47bb-0310-9956-ffa450edef68>2001-03-01 04:59:07 +0000
commit9e856d36956fb622525d95e0fcf52120515da35c (patch)
tree0132978c63fcc29b9594bfb2666ed813d1aac698
parent5fa037f3fda535c5b5ccff7e06d0bd16945d8894 (diff)
downloadlibapr-util-9e856d36956fb622525d95e0fcf52120515da35c.tar.gz
The destroy function for shared bucket types should not interchange
the use of a local variable and the 'void *data' parameter. It works, since the two are equivalent, but it's confusing to look at. Where possible, the local variable is removed entirely. Some bucket types have to dereference the pointer to free private data, though, so in those cases the local variable remains but it is now used consistently. Submitted by: Greg Stein git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@58153 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--buckets/apr_buckets_file.c4
-rw-r--r--buckets/apr_buckets_heap.c2
-rw-r--r--buckets/apr_buckets_mmap.c2
3 files changed, 3 insertions, 5 deletions
diff --git a/buckets/apr_buckets_file.c b/buckets/apr_buckets_file.c
index 62edf465..b349be08 100644
--- a/buckets/apr_buckets_file.c
+++ b/buckets/apr_buckets_file.c
@@ -86,10 +86,8 @@
static void file_destroy(void *data)
{
- apr_bucket_file *f = data;
-
if (apr_bucket_shared_destroy(data)) {
- free(f);
+ free(data);
}
}
diff --git a/buckets/apr_buckets_heap.c b/buckets/apr_buckets_heap.c
index 39bacae4..36df98ab 100644
--- a/buckets/apr_buckets_heap.c
+++ b/buckets/apr_buckets_heap.c
@@ -72,7 +72,7 @@ static void heap_destroy(void *data)
{
apr_bucket_heap *h = data;
- if (apr_bucket_shared_destroy(data)) {
+ if (apr_bucket_shared_destroy(h)) {
free(h->base);
free(h);
}
diff --git a/buckets/apr_buckets_mmap.c b/buckets/apr_buckets_mmap.c
index df83c589..93179051 100644
--- a/buckets/apr_buckets_mmap.c
+++ b/buckets/apr_buckets_mmap.c
@@ -78,7 +78,7 @@ static void mmap_destroy(void *data)
{
apr_bucket_mmap *m = data;
- if (apr_bucket_shared_destroy(data)) {
+ if (apr_bucket_shared_destroy(m)) {
/* XXX: apr_mmap_delete(m->mmap)? */
free(m);
}