#vulnerable code 
                             @Override
	public boolean initializeAdapter() {

		_LOG.info("Initializing MysqlAdapter....");

		try {

			boolean reachable = (java.lang.Runtime.getRuntime()
					.exec("ping -n 1 " + _ip).waitFor() == 0);

			if (!reachable)
				throw new Exception("Unable to reach IP....");

			Class.forName("com.mysql.jdbc.Driver");
			connection = DriverManager.getConnection("jdbc:mysql://" + _ip
					+ "/" + _tablename + "?user=" + _username + "&password="
					+ _password);

			connection.setReadOnly(true);

			if (!connection.isValid(0))
				throw new Exception("Invalid connection string....");

			_LOG.info("Set JDBC connection....");

			return true;
		} catch (Exception e) {
			e.printStackTrace();
			_LOG.error("JDBC connection failed....");

			return false;
		}

	} 
                            #location 9 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                             @Override
	public boolean initializeAdapter() {

		_LOG.info("Initializing MysqlAdapter....");

		try {

			

			Class.forName("com.mysql.jdbc.Driver");
			connection = DriverManager.getConnection("jdbc:mysql://" + _ip
					+ "/" + _tablename + "?user=" + _username + "&password="
					+ _password);

			connection.setReadOnly(true);

			if (!connection.isValid(0))
				throw new Exception("Invalid connection string....");

			_LOG.info("Set JDBC connection....");

			return true;
		} catch (Exception e) {
			e.printStackTrace();
			_LOG.error("JDBC connection failed....");

			return false;
		}

	}