aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_connection_handler.erl
diff options
context:
space:
mode:
authorNiclas Eklund <[email protected]>2011-04-27 16:05:01 +0200
committerNiclas Eklund <[email protected]>2011-04-27 16:05:01 +0200
commit0d2c45e628b0cd86bba0ad0ae6cdb58d6f9c024a (patch)
tree77d6b04ee4d470966a38497a9a942cc483ba60dd /lib/ssh/src/ssh_connection_handler.erl
parentd33d5047ac8c0730883454878be4ea88b3b0c2cc (diff)
downloadotp-0d2c45e628b0cd86bba0ad0ae6cdb58d6f9c024a.tar.gz
otp-0d2c45e628b0cd86bba0ad0ae6cdb58d6f9c024a.tar.bz2
otp-0d2c45e628b0cd86bba0ad0ae6cdb58d6f9c024a.zip
OTP-9232:
A memory leak has been fixed. I.e. per terminated connection the size of a pid and the length of a user name string was not cleared.
Diffstat (limited to 'lib/ssh/src/ssh_connection_handler.erl')
-rw-r--r--lib/ssh/src/ssh_connection_handler.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl
index 2d82e6d77d..3193be2510 100644
--- a/lib/ssh/src/ssh_connection_handler.erl
+++ b/lib/ssh/src/ssh_connection_handler.erl
@@ -578,7 +578,9 @@ handle_info({CloseTag, _Socket}, _StateName,
%% Reason. The return value is ignored.
%%--------------------------------------------------------------------
terminate(normal, _, #state{transport_cb = Transport,
- socket = Socket}) ->
+ socket = Socket,
+ manager = Pid}) ->
+ (catch ssh_userreg:delete_user(Pid)),
(catch Transport:close(Socket)),
ok;
@@ -810,7 +812,7 @@ handle_disconnect(#ssh_msg_disconnect{} = Msg,
#state{ssh_params = Ssh0, manager = Pid} = State) ->
{SshPacket, Ssh} = ssh_transport:ssh_packet(Msg, Ssh0),
try
- send_msg(SshPacket, State),
+ send_msg(SshPacket, State),
ssh_connection_manager:event(Pid, Msg)
catch
exit:{noproc, _Reason} ->
@@ -822,6 +824,7 @@ handle_disconnect(#ssh_msg_disconnect{} = Msg,
[Msg, Exit]),
error_logger:info_report(Report)
end,
+ (catch ssh_userreg:delete_user(Pid)),
{stop, normal, State#state{ssh_params = Ssh}}.
counterpart_versions(NumVsn, StrVsn, #ssh{role = server} = Ssh) ->