From: Damien Riegel Date: Wed, 8 Nov 2017 20:48:44 +0000 (-0500) Subject: conn: let mutt_socket_new add Connection to the list X-Git-Tag: neomutt-20180512~54^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=943c562e3c2b825fc25a0fac5260c106c1aca8df;p=neomutt conn: let mutt_socket_new add Connection to the list mutt_socket_new is followed by a call to TAILQ_INSERT_HEAD; and mutt_socket_free takes care of removing the Connection from the Connection list. Make these two more in pair by making mutt_socket_new adds the newly created Connection to the connection list. --- diff --git a/conn/socket.c b/conn/socket.c index 8f7b384e2..f33bce798 100644 --- a/conn/socket.c +++ b/conn/socket.c @@ -342,6 +342,8 @@ struct Connection *mutt_socket_new(void) struct Connection *conn = mutt_mem_calloc(1, sizeof(struct Connection)); conn->fd = -1; + TAILQ_INSERT_HEAD(&Connections, conn, entries); + return conn; } diff --git a/mutt_socket.c b/mutt_socket.c index 28b4799c2..8946a402f 100644 --- a/mutt_socket.c +++ b/mutt_socket.c @@ -69,8 +69,6 @@ struct Connection *mutt_conn_find(const struct Connection *start, const struct A conn = mutt_socket_new(); memcpy(&conn->account, account, sizeof(struct Account)); - TAILQ_INSERT_HEAD(&Connections, conn, entries); - if (Tunnel && *Tunnel) mutt_tunnel_socket_setup(conn); else if (account->flags & MUTT_ACCT_SSL)