#fixed code
                                public static Document load(File in, String charsetName, String baseUri) throws IOException {
        InputStream inStream = null;
        try {
            inStream = new FileInputStream(in);
            ByteBuffer byteData = readToByteBuffer(inStream);
            return parseByteData(byteData, charsetName, baseUri);
        } finally {
            if (inStream != null)
                inStream.close();
        }
    }
#vulnerable code 
                                public static Document load(File in, String charsetName, String baseUri) throws IOException {
        InputStream inStream = new FileInputStream(in);
        ByteBuffer byteData = readToByteBuffer(inStream);
        Document doc = parseByteData(byteData, charsetName, baseUri);
        inStream.close();
        return doc;
    } 
                            #location 6 
                            #vulnerability type RESOURCE_LEAK