From: Graham Leggett Date: Sat, 3 Jan 2009 14:59:18 +0000 (+0000) Subject: mod_auth_form: Fix a pool lifetime issue, don't remove the subrequest X-Git-Tag: 2.3.2~237 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ec926810c6dcda86105d334f9e5a81796f64acc;p=apache mod_auth_form: Fix a pool lifetime issue, don't remove the subrequest until the main request is cleaned up. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@731000 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 992356a1e8..bf436b43e3 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,8 @@ Changes with Apache 2.3.2 [ When backported to 2.2.x, remove entry from this file ] + *) mod_auth_form: Fix a pool lifetime issue, don't remove the subrequest + until the main request is cleaned up. [Graham Leggett] Changes with Apache 2.3.1 diff --git a/modules/aaa/mod_auth_form.c b/modules/aaa/mod_auth_form.c index dfbb30d2ea..a56b87f662 100644 --- a/modules/aaa/mod_auth_form.c +++ b/modules/aaa/mod_auth_form.c @@ -944,7 +944,12 @@ static int authenticate_form_authn(request_rec * r) /* make sure any user detected within the subrequest is saved back to * the main request. */ - r->user = rr->user; + r->user = apr_pstrdup(r->pool, rr->user); + + /* we cannot clean up rr at this point, as memory allocated to rr is + * referenced from the main request. It will be cleaned up when the + * main request is cleaned up. + */ /* insert the kept_body filter on the main request to guarantee the * input filter stack cannot be read a second time, optionally inject @@ -958,7 +963,6 @@ static int authenticate_form_authn(request_rec * r) r->kept_body = apr_brigade_create(r->pool, r->connection->bucket_alloc); } ap_request_insert_filter_fn(r); - ap_destroy_sub_req(rr); /* did the form ask to change the method? if so, switch in the redirect handler * to relaunch this request as the subrequest with the new method. If the