#fixed code
                                public void saveLatexToFile(String desc) {
        String fileName = this.latexFile + (calls++) + ".tex";
        File f = new File(fileName);
        try(FileOutputStream fs = new FileOutputStream(f)) {
            System.out.println("save latex file " + fileName);
            fs.write(this.toLatex(desc).getBytes("UTF-8"));
            fs.flush();
            fs.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (NumberFormatException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
#vulnerable code 
                                public void saveLatexToFile(String desc) {
        String fileName = this.latexFile + (calls++) + ".tex";
        File f = new File(fileName);
        FileOutputStream fs;
        try {
            System.out.println("save latex file " + fileName);
            fs = new FileOutputStream(f);
            fs.write(this.toLatex(desc).getBytes("UTF-8"));
            fs.flush();
            fs.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (NumberFormatException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    } 
                            #location 11 
                            #vulnerability type RESOURCE_LEAK