]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: session: properly clean the outgoing connection before freeing.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 29 Nov 2018 17:05:05 +0000 (18:05 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 1 Dec 2018 09:47:17 +0000 (10:47 +0100)
In session_free(), make sure the outgoing connection is not in the idle list
anymore, and it does no longer have an owner, so that it will properly be
destroyed and nobody will be able to access it.

src/session.c

index 807af2e409d1dcdacc0c692a35a09c8dfce5a1db..c23d35c06e8b5bcbba17079962cf1c3d1620107c 100644 (file)
@@ -78,9 +78,12 @@ void session_free(struct session *sess)
        if (conn != NULL && conn->mux)
                conn->mux->destroy(conn);
        conn = sess->srv_conn;
-       if (conn != NULL && conn->mux)
+       if (conn != NULL && conn->mux) {
+               LIST_DEL(&conn->list);
+               LIST_INIT(&conn->list);
+               conn->owner = NULL;
                conn->mux->destroy(conn);
-       else if (conn) {
+       else if (conn) {
                /* We have a connection, but not yet an associated mux.
                 * So destroy it now.
                 */