Changeset 9163d41


Ignore:
Timestamp:
Feb 10, 2015 9:57:27 PM (5 years ago)
Author:
dg2-new <dg2-new@…>
Branches:
master
Children:
c52047e, f87d006
Parents:
1be9bb2
Message:
  • I2PSnark, Jetty, SAM, crypto: findbugs resource leaks.
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/web/BasicServlet.java

    r1be9bb2 r9163d41  
    359359            response.setStatus(416);
    360360            response.setHeader("Content-Range", InclusiveByteRange.to416HeaderRangeString(content_length));
     361            in.close();
    361362            return;
    362363        }
  • apps/jetty/java/src/net/i2p/jetty/JettyStart.java

    r1be9bb2 r9163d41  
    2727import static net.i2p.app.ClientAppState.*;
    2828
     29import java.io.InputStream;
    2930import org.eclipse.jetty.util.component.LifeCycle;
    3031import org.eclipse.jetty.util.resource.Resource;
     
    6970        Properties properties=new Properties();
    7071        XmlConfiguration last=null;
     72        InputStream in = null;
    7173        for (int i = 0; i < args.length; i++) {
    7274            if (args[i].toLowerCase().endsWith(".properties")) {
    73                 properties.load(Resource.newResource(args[i]).getInputStream());
     75                in = Resource.newResource(args[i]).getInputStream();
     76                properties.load(in);
     77                in.close();
    7478            } else {
    7579                XmlConfiguration configuration = new XmlConfiguration(Resource.newResource(args[i]).getURL());
  • apps/sam/java/src/net/i2p/sam/client/SAMStreamSend.java

    r1be9bb2 r9163d41  
    175175       
    176176        public boolean openConnection() {
     177                        FileInputStream fin = null;
    177178            try {
    178                 FileInputStream fin = new FileInputStream(_destFile);
     179                fin = new FileInputStream(_destFile);
    179180                byte dest[] = new byte[1024];
    180181                int read = DataHelper.read(fin, dest);
     
    201202                _log.error("Unable to connect", ioe);
    202203                return false;
     204            } finally {
     205                if(fin != null) {
     206                    try {
     207                        fin.close();
     208                    } catch(IOException ioe) {}
     209                }
    203210            }
    204211        }
  • core/java/src/net/i2p/crypto/TrustedUpdate.java

    r1be9bb2 r9163d41  
    768768                try {
    769769                    bytesToSignInputStream.close();
    770                 } catch (IOException ioe) {
    771                 }
    772 
    773             fileInputStream = null;
     770                    fileInputStream.close();
     771                } catch (IOException ioe) {
     772                }
     773
    774774        }
    775775
  • history.txt

    r1be9bb2 r9163d41  
     12015-02-10 dg
     2 * I2PSnark, Jetty, SAM, crypto: findbugs resource leaks.
     3
    142015-02-07 zzz
    25 * SSU: Limit range for valid clock skew
Note: See TracChangeset for help on using the changeset viewer.