]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: checks: Don't forget to release the connection on error case.
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 24 Oct 2017 17:03:30 +0000 (19:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 25 Oct 2017 14:01:01 +0000 (16:01 +0200)
When switching the check code to a non-permanent connection, the new code
forgot to free the connection if an error happened and was returned by
connect_conn_chk(), leading to the check never be ran again.

src/checks.c

index e6cc42a1c3a8239b6c59f5607e885dfeadeb227d..880b47bc1a18f548f7587d02c17d11fa1e7e7f6d 100644 (file)
@@ -2118,6 +2118,10 @@ static struct task *process_chk_conn(struct task *t)
                }
 
                /* here, we have seen a synchronous error, no fd was allocated */
+               if (conn) {
+                       conn_free(conn);
+                       check->conn = conn = NULL;
+               }
 
                check->state &= ~CHK_ST_INPROGRESS;
                check_notify_failure(check);