Hi devs,
I suspect a memory leak in the following code/patch related to
ProxySourceAddress.
Since the local_addr is associated with the socket, it should have the same
pool (lifetime), which is conn->scpool and not conn->pool.
The less the socket is reused (disablereuse/is_address_reusable/backend
close), the more the leak is substantial (although not reusing a bound
socket to connect the same backend port can be problematic per se...).
Regards,
Yann.
Index: modules/proxy/proxy_util.c
===================================================================
--- modules/proxy/proxy_util.c (revision 1526127)
+++ modules/proxy/proxy_util.c (working copy)
@@ -2572,9 +2572,9 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const
proxy_function, backend_addr->family,
worker->s->hostname);
if (conf->source_address_set) {
- local_addr = apr_pmemdup(conn->pool, conf->source_address,
+ local_addr = apr_pmemdup(conn->scpool,
conf->source_address,
sizeof(apr_sockaddr_t));
- local_addr->pool = conn->pool;
+ local_addr->pool = conn->scpool;
rv = apr_socket_bind(newsock, local_addr);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
APLOGNO(00956)