mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-02-18 00:20:10 +00:00
Merge remote-tracking branch 'origin/GP-342_jpleasu_fix_ghidrajarbuilder_resource_leak' into Ghidra_9.2
This commit is contained in:
commit
c10d1f1b50
@ -754,7 +754,9 @@ public class GhidraJarBuilder implements GhidraLaunchable {
|
||||
long modifiedTime = file.lastModified();
|
||||
addToModuleTree(jarPath, module);
|
||||
if (extensionPointSuffixPattern.matcher(jarPath).matches()) {
|
||||
checkExtensionPointClass(jarPath, new FileInputStream(file));
|
||||
try (FileInputStream inStream = new FileInputStream(file)) {
|
||||
checkExtensionPointClass(jarPath, inStream);
|
||||
}
|
||||
}
|
||||
|
||||
if (prefix != null) {
|
||||
@ -775,16 +777,16 @@ public class GhidraJarBuilder implements GhidraLaunchable {
|
||||
return;
|
||||
}
|
||||
|
||||
InputStream in = new FileInputStream(file);
|
||||
try (InputStream in = new FileInputStream(file)) {
|
||||
|
||||
byte[] bytes = new byte[4096];
|
||||
int numRead;
|
||||
byte[] bytes = new byte[4096];
|
||||
int numRead;
|
||||
|
||||
while ((numRead = in.read(bytes)) != -1) {
|
||||
monitor.checkCanceled();
|
||||
jarOut.write(bytes, 0, numRead);
|
||||
while ((numRead = in.read(bytes)) != -1) {
|
||||
monitor.checkCanceled();
|
||||
jarOut.write(bytes, 0, numRead);
|
||||
}
|
||||
}
|
||||
in.close();
|
||||
|
||||
jarOut.closeEntry();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user