#vulnerable code 
                                public void setUp() throws Exception {
        super.setUp();
        instance = new QSufSort();
        File file = new File("data/test_file");
        byte[] data = new byte[(int) file.length()];
        try {
            new FileInputStream(file).read(data);
        } catch (Exception e) {
            e.printStackTrace();
            assertTrue("Could not read from data/test_file.", false);
        }
        instance.buildSuffixArray(data);
    } 
                            #location 7 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public void setUp() throws Exception {
        super.setUp();
        instance = new QSufSort();
        File inputFile = new File("data/test_file");

        byte[] fileData = new byte[(int) inputFile.length()];
        DataInputStream dis = new DataInputStream(
                new FileInputStream(inputFile));
        dis.readFully(fileData);
        byte[] data = (new String(fileData) + (char) 1).getBytes();
        instance.buildSuffixArray(data);
        fileSize = (int) (inputFile.length() + 1);
    }