BUG/MINOR: sink: invalid sft free in sink_deinit()

sft freeing attempt made in a575421 ("BUG/MINOR: sink: missing sft free in
sink_deinit()") is incomplete, because sink->sft is meant to be used as a
list and not a single sft entry.

Because of that, the previous fix only frees the first sft entry, which
fixes memory leaks for single-server forwarders (this is the case for
implicit rings), but could still result in memory leaks when multiple
servers are configured in a explicit ring sections.

What this patch does: instead of directly freeing sink->sft, it iterates
over every list members to free them.

It must be backported up to 2.4 with a575421.

(cherry picked from commit a26b736300a9da9f4d4e9723ef9b9d234dd6092c)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 6a366eaa20743eda45b920d082ffefb435088e2d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 4dcf617e3ff58aa9fdf4ac79f300f7edc8d7bd75)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 63480d05f80ecf4730d8fe80ede221bcce78aadb)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed