Fix potential resource leaks
See gh-11624
This commit is contained in:
committed by
Stephane Nicoll
parent
0b22eb90b5
commit
5a4238acfc
@@ -157,7 +157,9 @@ public class JarFile extends java.util.jar.JarFile {
|
||||
Manifest manifest = (this.manifest == null ? null : this.manifest.get());
|
||||
if (manifest == null) {
|
||||
if (this.type == JarFileType.NESTED_DIRECTORY) {
|
||||
manifest = new JarFile(this.getRootJarFile()).getManifest();
|
||||
try (JarFile rootJarFile = new JarFile(this.getRootJarFile())) {
|
||||
manifest = rootJarFile.getManifest();
|
||||
}
|
||||
}
|
||||
else {
|
||||
try (InputStream inputStream = getInputStream(MANIFEST_NAME,
|
||||
|
||||
Reference in New Issue
Block a user