]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: connection: don't forget to always delete the list's head
authorWilly Tarreau <w@1wt.eu>
Tue, 21 Aug 2018 16:33:20 +0000 (18:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 21 Aug 2018 16:33:20 +0000 (18:33 +0200)
During a test it happened that a connection was deleted before the
stream it's attached to, resulting in a crash related to the fix
18a85fe ("BUG/MEDIUM: streams: Don't forget to remove the si from
the wait list.") during the LIST_DEL(). Make sure to always delete
the list's head in this case so that other elements can safely
detach later.

This is purely 1.9, no backport is needed.

include/proto/connection.h

index 35b9dfe49d8cbeb0358ed8577d60596bb654844a..dfaaad78d2426a279a7b36024447cee04b7073c4 100644 (file)
@@ -709,6 +709,8 @@ static inline struct conn_stream *cs_new(struct connection *conn)
 /* Releases a connection previously allocated by conn_new() */
 static inline void conn_free(struct connection *conn)
 {
+       LIST_DEL(&conn->send_wait_list);
+       LIST_INIT(&conn->send_wait_list);
        pool_free(pool_head_connection, conn);
 }