always defer close on port check #356

This commit is contained in:
seriousm4x
2023-12-17 09:44:48 +01:00
parent 8d532a2e1a
commit a9fa2b6a46

View File

@@ -57,9 +57,6 @@ func CheckPort(host string, port string) bool {
if err != nil {
return false
}
if conn != nil {
defer conn.Close()
return true
}
return false
defer conn.Close()
return conn != nil
}