Skip to content

Commit

Permalink
Ensure that the socket is always closed
Browse files Browse the repository at this point in the history
  • Loading branch information
zhan9san committed Apr 25, 2021
1 parent 11beee3 commit 19dacad
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -1258,10 +1258,7 @@ func validateListenAPIServerPort(listenAPIServerPort int) {
if err != nil {
exit.Message(reason.Usage, "Sorry, the port provided with the --listen-apiserver-port flag is already allocated: {{.listenAPIServerPort}}.", out.V{"listenAPIServerPort": listenAPIServerPort})
}
err = ln.Close()
if err != nil {
exit.Message(reason.Usage, "Sorry, the port provided with the --listen-apiserver-port flag cannot be used: {{.listenAPIServerPort}}.", out.V{"listenAPIServerPort": listenAPIServerPort})
}
defer ln.Close()
}
}

Expand Down

0 comments on commit 19dacad

Please sign in to comment.