aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2015-09-17 09:40:04 +0200
committerDan Gudmundsson <[email protected]>2015-09-17 09:40:04 +0200
commitad7bb40d88acd0de5bdad9b64f8d8dd5c303fa48 (patch)
tree0dfb443a8d5ec304e09b85979c57014b7fff8793 /lib/stdlib/src
parentacc47d90e34e4552ffe99766da7ac95423db1e30 (diff)
downloadotp-ad7bb40d88acd0de5bdad9b64f8d8dd5c303fa48.tar.gz
otp-ad7bb40d88acd0de5bdad9b64f8d8dd5c303fa48.tar.bz2
otp-ad7bb40d88acd0de5bdad9b64f8d8dd5c303fa48.zip
stdlib: Fix leaking files after error_logger:logfile(close)
Introduced when changing state from tuple to record.
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/error_logger_file_h.erl10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/stdlib/src/error_logger_file_h.erl b/lib/stdlib/src/error_logger_file_h.erl
index 48c471924e..fea1656051 100644
--- a/lib/stdlib/src/error_logger_file_h.erl
+++ b/lib/stdlib/src/error_logger_file_h.erl
@@ -94,14 +94,8 @@ handle_call(filename, #st{filename=File}=State) ->
handle_call(_Query, State) ->
{ok, {error, bad_query}, State}.
-terminate(_Reason, State) ->
- case State of
- {Fd, _File, _Prev} ->
- ok = file:close(Fd);
- _ ->
- ok
- end,
- [].
+terminate(_Reason, #st{fd=Fd}) ->
+ file:close(Fd).
code_change(_OldVsn, State, _Extra) ->
{ok, State}.