]> granicus.if.org Git - apache/commitdiff
mod_auth_form: Fix a pool lifetime issue, don't remove the subrequest
authorGraham Leggett <minfrin@apache.org>
Sat, 3 Jan 2009 14:59:18 +0000 (14:59 +0000)
committerGraham Leggett <minfrin@apache.org>
Sat, 3 Jan 2009 14:59:18 +0000 (14:59 +0000)
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

CHANGES
modules/aaa/mod_auth_form.c

diff --git a/CHANGES b/CHANGES
index 992356a1e8872a8476b7f923b452e490b949d8c1..bf436b43e33fa20c9affb4c8189a4f72f33c2a0b 100644 (file)
--- 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
 
index dfbb30d2ea120bf49e25e9c4a3aedf83dfabfc17..a56b87f66261b33a37e37feab9bfdc9fcc658f13 100644 (file)
@@ -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