]> granicus.if.org Git - apache/commitdiff
* modules/filters/mod_include.c (handle_include): Fix possible
authorJoe Orton <jorton@apache.org>
Fri, 3 Jun 2005 10:12:50 +0000 (10:12 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 3 Jun 2005 10:12:50 +0000 (10:12 +0000)
variable corruption with nested includes.

PR: 12655

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@179763 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_include.c

index 538375681b0baef645a936236a2c1751f0ab2b4c..71b5e2b5a0f492de51e00ad849997ecfa9a60682 100644 (file)
@@ -1699,10 +1699,10 @@ static apr_status_t handle_include(include_ctx_t *ctx, ap_filter_t *f,
             SSI_CREATE_ERROR_BUCKET(ctx, f, bb);
         }
 
-        /* destroy the sub request */
-        if (rr) {
-            ap_destroy_sub_req(rr);
-        }
+        /* Do *not* destroy the subrequest here; it may have allocated
+         * variables in this r->subprocess_env in the subrequest's
+         * r->pool, so that pool must survive as long as this request.
+         * Yes, this is a memory leak. */
 
         if (error_fmt) {
             break;