BUG/MINOR: server: Memory leak of proxy.used_server_addr during deinit

GitHub Issue #1037 Reported a memory leak in deinit() caused by an
allocation made in sa2str() that was stored in srv_set_addr_desc().

When destroying each server for a proxy in deinit, include freeing the
memory in the key of server->addr_node.

The leak was introduced in commit 92149f9a8 ("MEDIUM: stick-tables: Add
srvkey option to stick-table") which is not in any released version so
no backport is needed.

Cc: Tim Duesterhus <tim@bastelstu.be>
This commit is contained in:
Thayne McCombs 2021-01-07 22:11:05 -07:00 committed by Willy Tarreau
parent 591fc3a330
commit 4fb255df03

View File

@ -2649,6 +2649,7 @@ void deinit(void)
free(s->available_conns);
free(s->curr_idle_thr);
free(s->resolvers_id);
free(s->addr_node.key);
if (s->use_ssl == 1 || s->check.use_ssl == 1 || (s->proxy->options & PR_O_TCPCHK_SSL)) {
if (xprt_get(XPRT_SSL) && xprt_get(XPRT_SSL)->destroy_srv)