BUG/MEDIUM: check: fix leak on agent-check purge
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 10 Aug 2021 14:23:49 +0000 (16:23 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 11 Aug 2021 12:40:21 +0000 (14:40 +0200)
commit26cb8342ad0084e61d81ecaad948ce85843a29b4
tree02be3382932b38956478cb78f97ad1f47ec03442
parent6d7fc446b47f1c51819ac519a1a1e52fdde6842b
BUG/MEDIUM: check: fix leak on agent-check purge

There is currently a leak on agent-check for dynamic servers. When
deleted, the check rules and vars are not liberated. This leak grows
each time a dynamic server with agent-check is deleted.

Replace the manual purge code by a free_check invocation which
centralizes all the details on check cleaning.

There is no leak for health check because in this case the proxy is the
owner of the check vars and rules.

This should not be backported, unless dynamic server checks are
backported.
src/check.c