25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-26 16:26:24 +01:00

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.
This commit is contained in:
Jonas Ådahl 2010-10-30 20:33:13 +02:00 committed by Badlop
parent 5168f68946
commit bacecae3dd

View File

@ -90,7 +90,13 @@ start(Module, SockMod, Socket, Opts) ->
end, end,
ReceiverMod:become_controller(Receiver, Pid); ReceiverMod:become_controller(Receiver, Pid);
{error, _Reason} -> {error, _Reason} ->
SockMod:close(Socket) SockMod:close(Socket),
case ReceiverMod of
ejabberd_receiver ->
ReceiverMod:close(Receiver);
_ ->
ok
end
end; end;
independent -> independent ->
ok; ok;