From: Simon Horman Date: Fri, 30 Jan 2015 02:22:55 +0000 (+0900) Subject: MEDIUM: Add free_check() helper X-Git-Tag: v1.6-dev1~155 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bfb5d33fe6eecb5ac313f0f3de8ecccc0b55da29;p=thirdparty%2Fhaproxy.git MEDIUM: Add free_check() helper Add free_check() helper to free the memory allocated by init_check(). Signed-off-by: Simon Horman --- diff --git a/include/proto/checks.h b/include/proto/checks.h index 1e65652eb7..24dec79f8a 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 ae981f8fb9..b2f89a5565 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: