Skip to content

Commit d65fd1f

Browse files
committed
Merge remote-tracking branch 'origin/GP-5225_dev747368_fix_fail_to_close_file.zip'
2 parents 98170e5 + 01984fa commit d65fd1f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/zip/ZipFileSystemFactory.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
*
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,8 +32,8 @@ public class ZipFileSystemFactory
3232
* Use "-Dghidra.file.formats.zip.ZipFileSystemFactory.USE_BUILTIN_ZIP_SUPPORT=true" jvm
3333
* startup option to disable use of 7zip libraries when opening zip filesystems.
3434
*/
35-
private static boolean USE_BUILTIN_ZIP_SUPPORT = Boolean
36-
.getBoolean("ghidra.file.formats.zip.ZipFileSystemFactory.USE_BUILTIN_ZIP_SUPPORT");
35+
private static boolean USE_BUILTIN_ZIP_SUPPORT =
36+
Boolean.getBoolean("ghidra.file.formats.zip.ZipFileSystemFactory.USE_BUILTIN_ZIP_SUPPORT");
3737

3838
private static final int START_BYTES_REQUIRED = 2;
3939

@@ -84,6 +84,7 @@ public GFileSystem create(FSRLRoot targetFSRL, ByteProvider byteProvider,
8484
ZipFileSystemBuiltin.TEMPFILE_PREFIX, monitor);
8585
deleteZipFileWhenDone = true;
8686
}
87+
FSUtilities.uncheckedClose(byteProvider, null);
8788
ZipFileSystemBuiltin fs = new ZipFileSystemBuiltin(targetFSRL, fsService);
8889
try {
8990
fs.mount(zipFile, deleteZipFileWhenDone, monitor);

0 commit comments

Comments
 (0)