From bacecae3dd5e126067a8d23865b876b4fecbcd02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Sat, 30 Oct 2010 20:33:13 +0200 Subject: [PATCH] Fixes a leak of ejabberd_receiver processes. When a (non-frontend) socket module without any custom receiver fails to start, the newly created ejabberd_receiver process needs to be properly closed. --- src/ejabberd_socket.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ejabberd_socket.erl b/src/ejabberd_socket.erl index 2c7dd783c..c33421ea2 100644 --- a/src/ejabberd_socket.erl +++ b/src/ejabberd_socket.erl @@ -90,7 +90,13 @@ start(Module, SockMod, Socket, Opts) -> end, ReceiverMod:become_controller(Receiver, Pid); {error, _Reason} -> - SockMod:close(Socket) + SockMod:close(Socket), + case ReceiverMod of + ejabberd_receiver -> + ReceiverMod:close(Receiver); + _ -> + ok + end end; independent -> ok;