diff options
author | Björn Gustavsson <[email protected]> | 2017-03-15 13:05:48 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-03-15 13:05:48 +0100 |
commit | cc1ca30031bbbf6d213e0a5b56aa0cc70a77fd15 (patch) | |
tree | 0df17c99336675cf17f3dd53a3267c790032b330 /lib/stdlib/src | |
parent | 8905555b45bdcfa103b734e7fc7ac4838d94c657 (diff) | |
parent | 59524c3fff40ac9792bb92449eb594fed52b423e (diff) | |
download | otp-cc1ca30031bbbf6d213e0a5b56aa0cc70a77fd15.tar.gz otp-cc1ca30031bbbf6d213e0a5b56aa0cc70a77fd15.tar.bz2 otp-cc1ca30031bbbf6d213e0a5b56aa0cc70a77fd15.zip |
Merge branch 'bjorn/stdlib/erl_tar'
* bjorn/stdlib/erl_tar:
erl_tar: Close files after reading from a tar file
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r-- | lib/stdlib/src/erl_tar.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/stdlib/src/erl_tar.erl b/lib/stdlib/src/erl_tar.erl index 086e77cd28..a54df939bf 100644 --- a/lib/stdlib/src/erl_tar.erl +++ b/lib/stdlib/src/erl_tar.erl @@ -1321,7 +1321,11 @@ foldl_read(TarName, Fun, Accu, #read_opts{}=Opts) when is_function(Fun,4) -> try open(TarName, [read|Opts#read_opts.open_mode]) of {ok, #reader{access=read}=Reader} -> - foldl_read(Reader, Fun, Accu, Opts); + try + foldl_read(Reader, Fun, Accu, Opts) + after + _ = close(Reader) + end; {error, _} = Err -> Err catch |