forked from I2P_Developers/i2p.i2p
* I2PSnark, Jetty, SAM, crypto: findbugs resource leaks.
This commit is contained in:
@@ -358,6 +358,7 @@ class BasicServlet extends HttpServlet
|
||||
writeHeaders(response, content, content_length);
|
||||
response.setStatus(416);
|
||||
response.setHeader("Content-Range", InclusiveByteRange.to416HeaderRangeString(content_length));
|
||||
in.close();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -26,6 +26,7 @@ import net.i2p.I2PAppContext;
|
||||
import net.i2p.app.*;
|
||||
import static net.i2p.app.ClientAppState.*;
|
||||
|
||||
import java.io.InputStream;
|
||||
import org.eclipse.jetty.util.component.LifeCycle;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.xml.XmlConfiguration;
|
||||
@@ -68,9 +69,12 @@ public class JettyStart implements ClientApp {
|
||||
public void parseArgs(String[] args) throws Exception {
|
||||
Properties properties=new Properties();
|
||||
XmlConfiguration last=null;
|
||||
InputStream in = null;
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
if (args[i].toLowerCase().endsWith(".properties")) {
|
||||
properties.load(Resource.newResource(args[i]).getInputStream());
|
||||
in = Resource.newResource(args[i]).getInputStream();
|
||||
properties.load(in);
|
||||
in.close();
|
||||
} else {
|
||||
XmlConfiguration configuration = new XmlConfiguration(Resource.newResource(args[i]).getURL());
|
||||
if (last!=null)
|
||||
|
@@ -174,8 +174,9 @@ public class SAMStreamSend {
|
||||
}
|
||||
|
||||
public boolean openConnection() {
|
||||
FileInputStream fin = null;
|
||||
try {
|
||||
FileInputStream fin = new FileInputStream(_destFile);
|
||||
fin = new FileInputStream(_destFile);
|
||||
byte dest[] = new byte[1024];
|
||||
int read = DataHelper.read(fin, dest);
|
||||
|
||||
@@ -200,6 +201,12 @@ public class SAMStreamSend {
|
||||
} catch (IOException ioe) {
|
||||
_log.error("Unable to connect", ioe);
|
||||
return false;
|
||||
} finally {
|
||||
if(fin != null) {
|
||||
try {
|
||||
fin.close();
|
||||
} catch(IOException ioe) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -767,10 +767,10 @@ riCe6OlAEiNpcc6mMyIYYWFICbrDFTrDR3wXqwc/Jkcx6L5VVWoagpSzbo3yGhc=
|
||||
if (bytesToSignInputStream != null)
|
||||
try {
|
||||
bytesToSignInputStream.close();
|
||||
fileInputStream.close();
|
||||
} catch (IOException ioe) {
|
||||
}
|
||||
|
||||
fileInputStream = null;
|
||||
}
|
||||
|
||||
FileOutputStream fileOutputStream = null;
|
||||
|
@@ -1,3 +1,6 @@
|
||||
2015-02-10 dg
|
||||
* I2PSnark, Jetty, SAM, crypto: findbugs resource leaks.
|
||||
|
||||
2015-02-07 zzz
|
||||
* SSU: Limit range for valid clock skew
|
||||
* Transport: Ban routers if they are too old and we are non-DSA
|
||||
|
Reference in New Issue
Block a user