From: Olivier Houchard Date: Thu, 29 Nov 2018 17:05:05 +0000 (+0100) Subject: BUG/MEDIUM: session: properly clean the outgoing connection before freeing. X-Git-Tag: v1.9-dev9~102 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d7d627c0b96c8f08b726d2dafb4fad6048d51cdd;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: session: properly clean the outgoing connection before freeing. 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. --- diff --git a/src/session.c b/src/session.c index 807af2e409..c23d35c06e 100644 --- a/src/session.c +++ b/src/session.c @@ -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. */