BUG/MINOR: proxy/stktable: missing frees on proxy cleanup
In 1b8e68e ("MEDIUM: stick-table: Stop handling stick-tables as proxies.")
we forgot to free the table pointer which is now dynamically allocated.
Let's take this opportunity to also fix a missing free in the table itself
(the table expire task wasn't properly destroyed)
This patch depends on:
- "MINOR: stktable: add sktable_deinit function"
It should be backported in every stable versions.
(cherry picked from commit 2c4943c18b8378d1314460ee1148fc90a6d51b67)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit febaa3ee840a4626aebe40f37967768ecf29549e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit dea2d6260dabd3ad7ab9119aa2eb4224fa8a514f)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit c8a8ac6098b88346b6ef828a733989bba763162e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/proxy.c b/src/proxy.c
index 40434d0..2290003 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -320,7 +320,9 @@
pool_destroy(p->req_cap_pool);
pool_destroy(p->rsp_cap_pool);
+
stktable_deinit(p->table);
+ ha_free(&p->table);
HA_RWLOCK_DESTROY(&p->lbprm.lock);
HA_RWLOCK_DESTROY(&p->lock);
diff --git a/src/stick_table.c b/src/stick_table.c
index f2d0472..5f0505e 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -685,6 +685,7 @@
{
if (!t)
return;
+ task_destroy(t->exp_task);
pool_destroy(t->pool);
}