]> granicus.if.org Git - apache/commitdiff
move a temporary table from r->pool to a temporary
authorJeff Trawick <trawick@apache.org>
Sat, 5 Apr 2014 11:57:46 +0000 (11:57 +0000)
committerJeff Trawick <trawick@apache.org>
Sat, 5 Apr 2014 11:57:46 +0000 (11:57 +0000)
pool we've already allocated in order to avoid a
longer lifetime than necessary for the table memory

Suggested by: jailletc36

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

modules/aaa/mod_authnz_fcgi.c

index 7c573d523d509c3255827b9d8c0926519aae4842..673b0e774d9b0b1fc51361232e769835191b95fb 100644 (file)
@@ -759,8 +759,6 @@ static void req_rsp(request_rec *r, const fcgi_provider_conf *conf,
         apr_socket_close(s);
     }
 
-    apr_pool_destroy(temp_pool);
-
     if (rv != APR_SUCCESS) {
         /* some sort of mechanical problem */
         r->status = HTTP_INTERNAL_SERVER_ERROR;
@@ -779,11 +777,17 @@ static void req_rsp(request_rec *r, const fcgi_provider_conf *conf,
          * available to subsequent phases via subprocess_env (and yanked
          * from the client response).
          */
-        apr_table_t *vars = apr_table_make(r->pool, 10);
+        apr_table_t *vars = apr_table_make(temp_pool, /* not used to allocate
+                                                       * any values that end up
+                                                       * in r->(anything)
+                                                       */
+                                           10);
         apr_table_do(mod_fcgid_modify_auth_header, vars,
                      r->err_headers_out, NULL);
         apr_table_do(fix_auth_header, r, vars, NULL);
     }
+
+    apr_pool_destroy(temp_pool);
 }
 
 static int fcgi_check_authn(request_rec *r)