From 78f70660d1a50fc80d1b8048e124175e3dddf29c Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Thu, 20 Dec 2007 08:57:23 +0000 Subject: [PATCH] * Using the reslist pool for the proxy_conn_rec structure introduces a memory 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 890cb8c1ac..edf020cee0 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -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; -- 2.50.1