#vulnerable code 
                                private String getPortForwardUrl(final Set<HasMetadata> resources) throws Exception {
        LabelSelector selector = KubernetesResourceUtil.getPodLabelSelector(resources);
        if (selector == null) {
            log.warn("Unable to determine a selector for application pods");
            return null;
        }

        PortForwardService portForwardService = getContext().getFabric8ServiceHub().getPortForwardService();
        // TODO choose the right ports
        portForwardService.forwardPortAsync(getContext().getLogger(), selector, 8080, 20000);
        return "http://localhost:20000";
    } 
                            #location 10 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                private String getPortForwardUrl(final Set<HasMetadata> resources) throws Exception {
        LabelSelector selector = KubernetesResourceUtil.getPodLabelSelector(resources);
        if (selector == null) {
            log.warn("Unable to determine a selector for application pods");
            return null;
        }

        PortForwardService portForwardService = getContext().getFabric8ServiceHub().getPortForwardService();
        int port = IoUtil.getFreeRandomPort();
        portForwardService.forwardPortAsync(getContext().getLogger(), selector, 8080, port);
        return "http://localhost:" + port;
    }