fix a leaky bucket.
Submitted by: Cliff Woolley <cliffwoolley@yahoo.com>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr-util/trunk@58084 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/buckets/apr_buckets_file.c b/buckets/apr_buckets_file.c
index fab6117..75eb55e 100644
--- a/buckets/apr_buckets_file.c
+++ b/buckets/apr_buckets_file.c
@@ -164,21 +164,15 @@
return APR_SUCCESS;
}
-static apr_status_t file_split(apr_bucket *e, apr_off_t offset)
+static void file_destroy(void *data)
{
- apr_bucket *b;
- apr_bucket_shared *s;
- apr_bucket_shared *temp = e->data;
apr_bucket_file *f;
- apr_bucket_split_shared(e, offset);
- b = APR_BUCKET_NEXT(e);
-
- s = b->data;
- f = s->data;
- s->start = offset + temp->start;
-
- return APR_SUCCESS;
+ f = apr_bucket_destroy_shared(data);
+ if (f == NULL) {
+ return;
+ }
+ free(f);
}
APU_DECLARE(apr_bucket *) apr_bucket_make_file(apr_bucket *b, apr_file_t *fd,
@@ -211,9 +205,9 @@
APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_file = {
"FILE", 5,
- free,
+ file_destroy,
file_read,
apr_bucket_setaside_notimpl,
- file_split,
+ apr_bucket_split_shared,
apr_bucket_copy_shared
};