From: Evgeniy Khramtsov Date: Thu, 6 Jul 2017 11:49:21 +0000 (+0300) Subject: Close accepted socket if sockname/peername has failed X-Git-Tag: 17.07 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a35b9dd9cc20d5e61dcd7782aa05bbf6a132bd78;p=ejabberd Close accepted socket if sockname/peername has failed Fixes #1834 --- diff --git a/src/ejabberd_listener.erl b/src/ejabberd_listener.erl index 6dd8e706d..3ea23d61b 100644 --- a/src/ejabberd_listener.erl +++ b/src/ejabberd_listener.erl @@ -302,7 +302,7 @@ accept(ListenSocket, Module, Opts, Interval) -> ejabberd_config:may_hide_data(inet_parse:ntoa(PAddr)), PPort, inet_parse:ntoa(Addr), Port]); _ -> - ok + gen_tcp:close(Socket) end, accept(ListenSocket, Module, Opts, NewInterval); {error, Reason} ->