You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2009/01/03 15:59:18 UTC

svn commit: r731000 - in /httpd/httpd/trunk: CHANGES modules/aaa/mod_auth_form.c

Author: minfrin
Date: Sat Jan  3 06:59:18 2009
New Revision: 731000

URL: http://svn.apache.org/viewvc?rev=731000&view=rev
Log:
mod_auth_form: Fix a pool lifetime issue, don't remove the subrequest
until the main request is cleaned up.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/aaa/mod_auth_form.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=731000&r1=730999&r2=731000&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sat Jan  3 06:59:18 2009
@@ -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
 

Modified: httpd/httpd/trunk/modules/aaa/mod_auth_form.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_auth_form.c?rev=731000&r1=730999&r2=731000&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_auth_form.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_auth_form.c Sat Jan  3 06:59:18 2009
@@ -944,7 +944,12 @@
         /* 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 @@
             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