From: Yann Ylavic Date: Wed, 14 Dec 2016 19:16:59 +0000 (+0000) Subject: http: release data buckets (memory, fd, ...) as soon as possible when X-Git-Tag: 2.5.0-alpha~908 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=60586e25cf018d677df6c06caf7e986c08bcc3f7;p=thirdparty%2Fapache%2Fhttpd.git http: release data buckets (memory, fd, ...) as soon as possible when filtered out from the outgoing brigade by ap_http_outerror_filter() applying the EOC semantic. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1774322 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c index fdc310a1e2f..0cb49b1bee0 100644 --- a/modules/http/http_filters.c +++ b/modules/http/http_filters.c @@ -1806,12 +1806,12 @@ apr_status_t ap_http_outerror_filter(ap_filter_t *f, * EOS bucket. */ if (ctx->seen_eoc) { - for (e = APR_BRIGADE_FIRST(b); - e != APR_BRIGADE_SENTINEL(b); - e = APR_BUCKET_NEXT(e)) - { - if (!APR_BUCKET_IS_METADATA(e)) { - APR_BUCKET_REMOVE(e); + e = APR_BRIGADE_FIRST(b); + while (e != APR_BRIGADE_SENTINEL(b)) { + apr_bucket *c = e; + e = APR_BUCKET_NEXT(e); + if (!APR_BUCKET_IS_METADATA(c)) { + apr_bucket_delete(c); } } }