diff --git a/pkg/util/portScanner.go b/pkg/util/portScanner.go index 85cfdcc1f..6b0ee2299 100644 --- a/pkg/util/portScanner.go +++ b/pkg/util/portScanner.go @@ -41,7 +41,7 @@ func CheckFreePorts(address string, ports []int) map[int]struct{} { } }() - for range len(ports) { + for range ports { port := <-results if port != 0 { freeports[port] = struct{}{}