MEDIUM: Add free_check() helper

Add free_check() helper to free the memory allocated by init_check().

Signed-off-by: Simon Horman <horms@verge.net.au>
This commit is contained in:
Simon Horman 2015-01-30 11:22:55 +09:00 committed by Willy Tarreau
parent b1900d55df
commit bfb5d33fe6
2 changed files with 8 additions and 0 deletions

View File

@ -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 */

View File

@ -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: