]> granicus.if.org Git - ejabberd/commitdiff
Close accepted socket if sockname/peername has failed 17.07
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Thu, 6 Jul 2017 11:49:21 +0000 (14:49 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Thu, 6 Jul 2017 11:49:21 +0000 (14:49 +0300)
Fixes #1834

src/ejabberd_listener.erl

index 6dd8e706d8511c504b659279a8058b935b98334d..3ea23d61b3dfc436633dd086a6b0328f2aa28803 100644 (file)
@@ -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} ->