#fixed code
                                protected void testHttpLenient(final String cT, final String bomEnc, final String streamEnc, final String prologEnc, final String shouldbe)
            throws Exception {
        final InputStream is;
        if (prologEnc == null) {
            is = getXmlStream(bomEnc, XML2, streamEnc, prologEnc);
        } else {
            is = getXmlStream(bomEnc, XML3, streamEnc, prologEnc);
        }
        final XmlReader xmlReader = new XmlReader(is, cT, true);
        assertEquals(xmlReader.getEncoding(), shouldbe);
        xmlReader.close();
    }
#vulnerable code 
                                protected void testHttpLenient(final String cT, final String bomEnc, final String streamEnc, final String prologEnc, final String shouldbe)
            throws Exception {
        final InputStream is;
        if (prologEnc == null) {
            is = getXmlStream(bomEnc, XML2, streamEnc, prologEnc);
        } else {
            is = getXmlStream(bomEnc, XML3, streamEnc, prologEnc);
        }
        final XmlReader xmlReader = new XmlReader(is, cT, true);
        assertEquals(xmlReader.getEncoding(), shouldbe);
    } 
                            #location 10 
                            #vulnerability type RESOURCE_LEAK