From: Willy Tarreau Date: Sun, 8 Oct 2017 09:10:19 +0000 (+0200) Subject: MEDIUM: checks: exclusively use cs_destroy() to release a connection X-Git-Tag: v1.8-rc1~79 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ac59f361badb83abf960d1a71c9648a36a6c164e;p=thirdparty%2Fhaproxy.git MEDIUM: checks: exclusively use cs_destroy() to release a connection This way we're using the more consistent API everywhere. --- diff --git a/src/checks.c b/src/checks.c index 49d9467032..0b72bb21d7 100644 --- a/src/checks.c +++ b/src/checks.c @@ -2210,7 +2210,7 @@ static struct task *process_chk_conn(struct task *t) cs_close(cs); } - if (conn) { + if (cs) { cs_destroy(cs); cs = check->cs = NULL; conn = NULL; @@ -2706,11 +2706,8 @@ static int tcpcheck_main(struct check *check) return retcode; } - if (check->cs) { - if (check->cs->conn) - conn_free(check->cs->conn); - cs_free(check->cs); - } + if (check->cs) + cs_destroy(check->cs); check->cs = cs; conn = cs->conn;