#vulnerable code 
                                static String load(File in, String charsetName) throws IOException {        
        char[] buffer = new char[0x20000]; // ~ 130K
        StringBuilder data = new StringBuilder(0x20000);
        InputStream inStream = new FileInputStream(in);
        Reader inReader = new InputStreamReader(inStream, charsetName);
        int read;
        do {
            read = inReader.read(buffer, 0, buffer.length);
            if (read > 0) {
                data.append(buffer, 0, read);
            }
            
        } while (read >= 0);
        
        return data.toString();        
    } 
                            #location 5 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                static String load(File in, String charsetName) throws IOException {        
        InputStream inStream = new FileInputStream(in);
        String data = readInputStream(inStream, charsetName);
        inStream.close();
        return data;
    }