#vulnerable code 
                                public static Properties load(InputStream inputStream) throws ParserConfigurationException, SAXException,
            IOException {
        SAXParserFactory factory = SAXParserFactory.newInstance();
        factory.setValidating(true);
        factory.setNamespaceAware(true);
        SAXParser parser = factory.newSAXParser();

        StringWriter output = new StringWriter();
        PrintWriter pw = new PrintWriter(output);
        XmlToPropsHandler h = new XmlToPropsHandler(pw);
        parser.setProperty("http://xml.org/sax/properties/lexical-handler", h);

        parser.parse(inputStream, h);
        pw.flush();
        output.flush();

        System.out.println("Output:\n" + output);

        Properties props = new Properties();
        props.load(new StringReader(output.toString()));
        return props;
    } 
                            #location 14 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public static Properties load(InputStream inputStream) throws ParserConfigurationException, SAXException,
            IOException {
        SAXParserFactory factory = SAXParserFactory.newInstance();
        factory.setValidating(true);
        factory.setNamespaceAware(true);
        SAXParser parser = factory.newSAXParser();

        Properties props = new Properties();
        XmlToPropsHandler h = new XmlToPropsHandler(props);
        parser.setProperty("http://xml.org/sax/properties/lexical-handler", h);

        parser.parse(inputStream, h);

        System.out.println("Output:\n");
        props.store(System.out, "output");

        return props;
    }