]> granicus.if.org Git - apache/commitdiff
* Using the reslist pool for the proxy_conn_rec structure introduces a memory
authorRuediger Pluem <rpluem@apache.org>
Thu, 20 Dec 2007 08:57:23 +0000 (08:57 +0000)
committerRuediger Pluem <rpluem@apache.org>
Thu, 20 Dec 2007 08:57:23 +0000 (08:57 +0000)
  leak when connections get created and destroyed frequently by the reslist
  (e.g.  destroying idle elements of the reslist). So use the subpool
  dedicated for the proxy_conn_rec structure to allocate the memory for the
  structure itself.

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

modules/proxy/proxy_util.c

index 890cb8c1ac084e4f89d01311c43a86b2f9c9f542..edf020cee0836caa9d3de264c88805cd92b1b147 100644 (file)
@@ -1655,7 +1655,7 @@ static apr_status_t connection_cleanup(void *theconn)
     if (conn->close || !worker->is_address_reusable) {
         apr_pool_t *p = conn->pool;
         apr_pool_clear(p);
-        memset(conn, 0, sizeof(proxy_conn_rec));
+        conn = apr_pcalloc(p, sizeof(proxy_conn_rec));
         conn->pool = p;
         conn->worker = worker;
         apr_pool_create(&(conn->scpool), p);
@@ -1743,7 +1743,7 @@ static apr_status_t connection_constructor(void **resource, void *params,
      */
     apr_pool_create(&scpool, ctx);
     apr_pool_tag(scpool, "proxy_conn_scpool");
-    conn = apr_pcalloc(pool, sizeof(proxy_conn_rec));
+    conn = apr_pcalloc(ctx, sizeof(proxy_conn_rec));
 
     conn->pool   = ctx;
     conn->scpool = scpool;