baidu/openrasp

Resources should be closed

QiAnXinCodeSafe opened this issue · 2 comments

OutputStream out = new FileOutputStream(outFile);
byte[] buffer = new byte[1024];
int i;
while ((i = in.read(buffer)) != -1) {
out.write(buffer, 0, i);
}
out.flush();
try {
out.close();
in.close();
} catch (Throwable t) {
// ignore
}
JarFile file = new JarFile(outFile);
Dependency dependency = loadDependencyFromJarFile(file, path);
file.close();
return dependency;

Use try-with-resources or close this "FileOutputStream" in a "finally" clause.

收到,确实是个问题,将在 v.1.3.7 修复