diff options
author | Rob Campbell <kg6hum@gmail.com> | 2016-09-19 02:20:52 -0700 |
---|---|---|
committer | Rob Campbell <kg6hum@gmail.com> | 2016-09-19 02:20:52 -0700 |
commit | cb382a01744face32eb16cd4f62df7aebeffbefd (patch) | |
tree | 8d4c0c1473988fdcc5aeb3e3955f3642cfeb0738 | |
parent | 58ce36c2c9473e5e16dc6285a87f7e2c741bd3a5 (diff) | |
download | weechat-cb382a01744face32eb16cd4f62df7aebeffbefd.zip |
Fix for unclosed/leaking sockets from issue #358
-rw-r--r-- | src/plugins/irc/irc-server.c | 5 |
1 files 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; |