From cb382a01744face32eb16cd4f62df7aebeffbefd Mon Sep 17 00:00:00 2001 From: Rob Campbell Date: Mon, 19 Sep 2016 02:20:52 -0700 Subject: Fix for unclosed/leaking sockets from issue #358 --- src/plugins/irc/irc-server.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index aa09d47c9..cb6c2c336 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -3504,12 +3504,13 @@ irc_server_connect_cb (const void *pointer, void *data, proxy = IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_PROXY); server->hook_connect = NULL; + /* set socket */ + server->sock = sock; switch (status) { case WEECHAT_HOOK_CONNECT_OK: - /* set socket and IP */ - server->sock = sock; + /* set IP */ if (server->current_ip) free (server->current_ip); server->current_ip = (ip_address) ? strdup (ip_address) : NULL; -- cgit v1.2.3