Add free_check() helper to free the memory allocated by init_check(). Signed-off-by: Simon Horman <ho...@verge.net.au> --- include/proto/checks.h | 1 + src/checks.c | 7 +++++++ 2 files changed, 8 insertions(+)
diff --git a/include/proto/checks.h b/include/proto/checks.h index 1e65652..24dec79 100644 --- a/include/proto/checks.h +++ b/include/proto/checks.h @@ -45,6 +45,7 @@ static inline void health_adjust(struct server *s, short status) } const char *init_check(struct check *check, int type); +void free_check(struct check *check); #endif /* _PROTO_CHECKS_H */ diff --git a/src/checks.c b/src/checks.c index ae981f8..b2f89a5 100644 --- a/src/checks.c +++ b/src/checks.c @@ -2807,6 +2807,13 @@ const char *init_check(struct check *check, int type) return NULL; } +void free_check(struct check *check) +{ + free(check->bi); + free(check->bo); + free(check->conn); +} + /* * Local variables: -- 2.1.4