#vulnerable code 
                             @Override
	public void postProcessEnvironment(ConfigurableEnvironment environment,
			SpringApplication application) {

		final boolean kubernetesEnabled = environment
				.getProperty("spring.cloud.kubernetes.enabled", Boolean.class, true);
		if (!kubernetesEnabled) {
			return;
		}

		final StandardPodUtils podUtils = new StandardPodUtils(
				new DefaultKubernetesClient());
		if (podUtils.isInsideKubernetes()) {
			if (hasKubernetesProfile(environment)) {
				if (LOG.isDebugEnabled()) {
					LOG.debug("'kubernetes' already in list of active profiles");
				}
			}
			else {
				if (LOG.isDebugEnabled()) {
					LOG.debug("Adding 'kubernetes' to list of active profiles");
				}
				environment.addActiveProfile(KUBERNETES_PROFILE);
			}
		}
		else {
			if (LOG.isDebugEnabled()) {
				LOG.warn(
						"Not running inside kubernetes. Skipping 'kubernetes' profile activation.");
			}
		}
	} 
                            #location 13 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                             @Override
	public void postProcessEnvironment(ConfigurableEnvironment environment,
			SpringApplication application) {

		final boolean kubernetesEnabled = environment
				.getProperty("spring.cloud.kubernetes.enabled", Boolean.class, true);
		if (!kubernetesEnabled) {
			return;
		}

		if (isInsideKubernetes()) {
			if (hasKubernetesProfile(environment)) {
				if (LOG.isDebugEnabled()) {
					LOG.debug("'kubernetes' already in list of active profiles");
				}
			}
			else {
				if (LOG.isDebugEnabled()) {
					LOG.debug("Adding 'kubernetes' to list of active profiles");
				}
				environment.addActiveProfile(KUBERNETES_PROFILE);
			}
		}
		else {
			if (LOG.isDebugEnabled()) {
				LOG.warn(
						"Not running inside kubernetes. Skipping 'kubernetes' profile activation.");
			}
		}
	}