#fixed code
                             @Override
	public List<URL> getDrivers() throws IOException {
		URL driverUrl = getDriverUrl();
		String driverVersion = versionToDownload;

		BufferedReader reader = new BufferedReader(
				new InputStreamReader(openGitHubConnection(driverUrl)));

		GsonBuilder gsonBuilder = new GsonBuilder();
		Gson gson = gsonBuilder.create();
		GitHubApi[] releaseArray = gson.fromJson(reader, GitHubApi[].class);
		if (driverVersion != null) {
			releaseArray = new GitHubApi[] {
					getVersion(releaseArray, driverVersion) };
		}

		List<URL> urls = new ArrayList<>();
		for (GitHubApi release : releaseArray) {
			if (release != null) {
				List<LinkedTreeMap<String, Object>> assets = release
						.getAssets();
				for (LinkedTreeMap<String, Object> asset : assets) {
					urls.add(new URL(
							asset.get("browser_download_url").toString()));
				}
			}
		}

		reader.close();
		return urls;
	}
#vulnerable code 
                             @Override
	public List<URL> getDrivers() throws IOException {
		URL driverUrl = getDriverUrl();
		String driverVersion = versionToDownload;

		BufferedReader reader = new BufferedReader(
				new InputStreamReader(openGitHubConnection(driverUrl)));

		GsonBuilder gsonBuilder = new GsonBuilder();
		Gson gson = gsonBuilder.create();
		GitHubApi[] releaseArray = gson.fromJson(reader, GitHubApi[].class);
		GitHubApi release;
		if (driverVersion == null || driverVersion.isEmpty() || driverVersion
				.equalsIgnoreCase(DriverVersion.LATEST.name())) {
			log.debug("Connecting to {} to check latest OperaDriver release",
					driverUrl);
			driverVersion = releaseArray[0].getName();
			log.debug("Latest driver version: {}", driverVersion);
			release = releaseArray[0];
		} else {
			release = getVersion(releaseArray, driverVersion);
		}
		if (release == null) {
			throw new RuntimeException("Version " + driverVersion
					+ " is not available for OperaDriver");
		}

		List<LinkedTreeMap<String, Object>> assets = release.getAssets();
		List<URL> urls = new ArrayList<>();
		for (LinkedTreeMap<String, Object> asset : assets) {
			urls.add(new URL(asset.get("browser_download_url").toString()));
		}

		reader.close();
		return urls;
	} 
                            #location 24 
                            #vulnerability type RESOURCE_LEAK