From: Graham Leggett Date: Tue, 6 Oct 2015 22:04:24 +0000 (+0000) Subject: Make sure we free the main request rather than the final internal X-Git-Tag: 2.5.0-alpha~2750 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91b4321bfac34c6a089af37d7b31e6699679622a;p=apache Make sure we free the main request rather than the final internal redirect. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1707155 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_request.c b/modules/http/http_request.c index 28580c67db..21af994271 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -256,14 +256,6 @@ AP_DECLARE(void) ap_process_request_after_handler(request_rec *r) apr_bucket *b; conn_rec *c = r->connection; - /* Find the last request, taking into account internal - * redirects. We want to send the EOR bucket at the end of - * all the buckets so it does not jump the queue. - */ - while (r->next) { - r = r->next; - } - /* Send an EOR bucket through the output filter chain. When * this bucket is destroyed, the request will be logged and * its pool will be freed @@ -272,6 +264,14 @@ AP_DECLARE(void) ap_process_request_after_handler(request_rec *r) b = ap_bucket_eor_create(c->bucket_alloc, r); APR_BRIGADE_INSERT_HEAD(bb, b); + /* Find the last request, taking into account internal + * redirects. We want to send the EOR bucket at the end of + * all the buckets so it does not jump the queue. + */ + while (r->next) { + r = r->next; + } + ap_pass_brigade(r->output_filters, bb); /* The EOR bucket has either been handled by an output filter (eg.