tls-autodetect: avoid a goroutine leak on timeout

This commit is contained in:
Přemysl Eric Janouch 2018-07-23 05:33:50 +02:00
parent a8f02e0d37
commit e8602ee718
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -322,7 +322,7 @@ func prepare(client *client) {
// The Cgo resolver doesn't pthread_cancel getnameinfo threads, so not // The Cgo resolver doesn't pthread_cancel getnameinfo threads, so not
// bothering with pointless contexts. // bothering with pointless contexts.
ch := make(chan string) ch := make(chan string, 1)
go func() { go func() {
defer close(ch) defer close(ch)
if names, err := net.LookupAddr(host); err != nil { if names, err := net.LookupAddr(host); err != nil {