#vulnerable code 
                                public void uppendToLatexFile(String desc, String fileName) {
        try {
            System.out.println("save latex file " + fileName);
            OutputStreamWriter char_output = new OutputStreamWriter(
                new FileOutputStream(fileName),
                Charset.forName("UTF-8").newEncoder()
            );
            BufferedWriter fs;
            fs = new BufferedWriter(char_output);
            fs.append(this.toLatex(desc));
            fs.flush();
            fs.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (NumberFormatException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    } 
                            #location 13 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public void uppendToLatexFile(String desc, String fileName) {
        try(OutputStreamWriter char_output = new OutputStreamWriter(new FileOutputStream(fileName),
                                                                    Charset.forName("UTF-8").newEncoder());
            BufferedWriter fs = new BufferedWriter(char_output)) {

            System.out.println("save latex file " + fileName);
            fs.append(this.toLatex(desc));
            fs.flush();
            fs.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (NumberFormatException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }