]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: proxy/stktable: missing frees on proxy cleanup
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 16 Nov 2023 15:18:14 +0000 (16:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 18 Nov 2023 10:16:21 +0000 (11:16 +0100)
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.

src/proxy.c
src/stick_table.c

index 3407168d13c65bb4debb547f0b0a7f5a47b937dc..93f1403dbec151984a738d5d96f73533eee8c27f 100644 (file)
@@ -389,7 +389,9 @@ void free_proxy(struct proxy *p)
 
        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);
index 26ea97addd3255c2b9f066763f8746a1a86caa5a..6427568314c3798f45aa7ca6c5bb334611f853d2 100644 (file)
@@ -875,6 +875,7 @@ void stktable_deinit(struct stktable *t)
 {
        if (!t)
                return;
+       task_destroy(t->exp_task);
        pool_destroy(t->pool);
 }