question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A created ZipInputStream is never closed and this causes a resource leakage

See original GitHub issue

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
reinracommented, Jun 27, 2017

Thanks for pointing this out. To keep the semantics I would wrap the passed-in InputStream into an uncloseable InputStream, pass this to the ZipInputStream and close it so that the original stream remains unclosed. We need to keep it open if it’s actually an entry of another ZipInputStream e.g.

0reactions
lhotaricommented, Jun 27, 2017

@reinra Looks great. Thanks for the quick turnaround. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Strange "Resource leak: stream is never closed" with try-with ...
This appears to be a known bug in Eclipse: [compiler][resource] Bad resource leak problem on return inside while loop (resource passed on in ......
Read more >
358903 – Filter practically unimportant resource leak warnings
With this patch and with resource leak warning enabled I'm down to 4 warnings in JDT/Core: Resource leak: 'file' is never closed Util.java ......
Read more >
ZipFile.close() does not close ZipFileInputStreams, contrary to ...
This leads to a native memory leak if the input streams are not closed explicitly, because the native buffer created for each ZipEntry...
Read more >
Resource leak: 'input' is never closed VisualStudioCode(VSC ...
In this video I show that when we coding in java programming throw visual studio code editor, we see a common problem ,that's...
Read more >
IDS04-J. Safely extract files from ZipInputStream - Confluence
A number of security concerns must be considered when extracting file entries from a ZIP file using java.util.zip.ZipInputStream . File names may contain...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found