Skip to content

Fix ZipFile.close() to close all open streams on failure - #582

Merged
srikanth-lingala merged 1 commit into
srikanth-lingala:masterfrom
iamsanjaymalakar:master
Mar 11, 2026
Merged

Fix ZipFile.close() to close all open streams on failure#582
srikanth-lingala merged 1 commit into
srikanth-lingala:masterfrom
iamsanjaymalakar:master

Conversation

@iamsanjaymalakar

Copy link
Copy Markdown
Contributor

Problem
ZipFile.close() closed openInputStreams sequentially. If one InputStream.close() threw an IOException, the method exited early, leaving remaining streams unclosed and potentially keeping resources open.

Fix
Update close() to attempt closing all tracked streams, collect the first IOException and attach subsequent failures as suppressed exceptions, then clear the list and rethrow after cleanup.

@srikanth-lingala

Copy link
Copy Markdown
Owner

Thanks for the fix. Appreciate it. I will merge it after the build succeeds.

@srikanth-lingala
srikanth-lingala merged commit 7172166 into srikanth-lingala:master Mar 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants