/* here, we know that the check is complete or that it failed */
if (check->result != CHK_RES_UNKNOWN)
- goto out_end_tcpcheck;
+ goto out;
/* 1- check for connection error, if any */
if ((conn && conn->flags & CO_FL_ERROR) || (cs && cs->flags & CS_FL_ERROR))
if ((conn && conn->flags & CO_FL_ERROR) || (cs && cs->flags & CS_FL_ERROR))
chk_report_conn_err(check, errno, 0);
- /* cleanup before leaving */
- check->current_step = NULL;
- if (check->sess != NULL) {
- vars_prune(&check->vars, check->sess, NULL);
- session_free(check->sess);
- check->sess = NULL;
- }
out:
return retcode;
}
/* check complete or aborted */
check->current_step = NULL;
- if (check->sess != NULL) {
- session_free(check->sess);
- check->sess = NULL;
- }
if (conn && conn->xprt) {
/* The check was aborted and the connection was not yet closed.
conn = NULL;
}
+ if (check->sess != NULL) {
+ vars_prune(&check->vars, check->sess, NULL);
+ session_free(check->sess);
+ check->sess = NULL;
+ }
+
if (check->server) {
if (check->result == CHK_RES_FAILED) {
/* a failure or timeout detected */