#vulnerable code 
                                @Override
    protected Optional<String> getLatestVersion() {
        String url = config().getChromeDriverUrl() + "LATEST_RELEASE";
        HttpGet request = new HttpGet(url);
        request.addHeader("User-Agent", USER_AGENT);
        HttpResponse response;
        Optional<String> version = Optional.empty();
        try {
            response = httpClient.execute(request);
            BufferedReader rd = new BufferedReader(
                    new InputStreamReader(response.getEntity().getContent()));
            version = Optional.of(IOUtils.toString(rd));
        } catch (IOException e) {
            log.warn("Exception reading {} to get latest version of {}", url,
                    getDriverName(), e);
        }
        log.debug("Latest version of {} according to {} is {}", getDriverName(),
                url, version);
        return version;
    } 
                            #location 12 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Override
    protected Optional<String> getLatestVersion() {
        String url = config().getChromeDriverUrl() + "LATEST_RELEASE";
        Optional<String> version = Optional.empty();
        try {
            InputStream response = httpClient
                    .execute(httpClient.createHttpGet(new URL(url))).getEntity()
                    .getContent();
            version = Optional.of(IOUtils.toString(response, defaultCharset()));
        } catch (Exception e) {
            log.warn("Exception reading {} to get latest version of {}", url,
                    getDriverName(), e);
        }
        if (version.isPresent()) {
            log.debug("Latest version of {} according to {} is {}",
                    getDriverName(), url, version.get());
        }
        return version;
    }