]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: sink: invalid sft free in sink_deinit()
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 10 Jul 2023 13:17:12 +0000 (15:17 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 10 Jul 2023 16:28:08 +0000 (18:28 +0200)
commita26b736300a9da9f4d4e9723ef9b9d234dd6092c
treed2de9b7389f97584b15704f0de1d7461b39f7776
parent9f9d557468befde23be828df5f35f529079bebd0
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.
src/sink.c