]> granicus.if.org Git - apache/commitdiff
* Use the correct pool for apr_table_copy. Otherwise we trigger the bad pool
authorRuediger Pluem <rpluem@apache.org>
Mon, 13 Feb 2006 22:58:03 +0000 (22:58 +0000)
committerRuediger Pluem <rpluem@apache.org>
Mon, 13 Feb 2006 22:58:03 +0000 (22:58 +0000)
  ancestry abort in apr_table_copy if apr is compiled with APR_POOL_DEBUG.

Noticed by: Joe Orton

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

modules/proxy/mod_proxy_http.c

index 7a5b4a38702285aed6ba668f5ec1ab43fe5f72f2..f1bb31d4352508bafd0c16a1e5fde13ceb55dc49 100644 (file)
@@ -725,8 +725,14 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
      * Make a copy of the headers_in table before clearing the connection
      * headers as we need the connection headers later in the http output
      * filter to prepare the correct response headers.
+     *
+     * Note: We need to take r->pool for apr_table_copy as the key / value
+     * pairs in r->headers_in have been created out of r->pool and
+     * p might be (and actually is) a longer living pool.
+     * This would trigger the bad pool ancestry abort in apr_table_copy if
+     * apr is compiled with APR_POOL_DEBUG.
      */
-    headers_in_copy = apr_table_copy(p, r->headers_in);
+    headers_in_copy = apr_table_copy(r->pool, r->headers_in);
     ap_proxy_clear_connection(p, headers_in_copy);
     /* send request headers */
     headers_in_array = apr_table_elts(headers_in_copy);