From 8ab8a6eee5297c440e0a0dd1edec90a2def515f5 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Wed, 19 Dec 2018 23:21:46 +0100 Subject: [PATCH] BUG/MAJOR: connections: Close the connection before freeing it. In si_release_endpoint(), if the end point is a connection, because we don't know which mux to use it, make sure we close the connection before freeing it, or else, we'd have a fd left for polling, which would point to a now free'd connection. This should be backported to 1.9. --- include/proto/stream_interface.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h index f4ba6ee89..cdc2245f6 100644 --- a/include/proto/stream_interface.h +++ b/include/proto/stream_interface.h @@ -173,8 +173,11 @@ static inline void si_release_endpoint(struct stream_interface *si) if (appctx->applet->release && si->state < SI_ST_DIS) appctx->applet->release(appctx); appctx_free(appctx); /* we share the connection pool */ - } else if ((conn = objt_conn(si->end))) + } else if ((conn = objt_conn(si->end))) { + conn_stop_tracking(conn); + conn_full_close(conn); conn_free(conn); + } si_detach_endpoint(si); }