httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r731000 - in /httpd/httpd/trunk: CHANGES modules/aaa/mod_auth_form.c
Date Sat, 03 Jan 2009 14:59:18 GMT
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



Mime
View raw message