From e8602ee718866c83bf58e5cbe32ab1ab6b916969 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Mon, 23 Jul 2018 05:33:50 +0200 Subject: tls-autodetect: avoid a goroutine leak on timeout --- prototypes/tls-autodetect.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prototypes/tls-autodetect.go b/prototypes/tls-autodetect.go index 3ff4128..4ce665b 100644 --- a/prototypes/tls-autodetect.go +++ b/prototypes/tls-autodetect.go @@ -322,7 +322,7 @@ func prepare(client *client) { // The Cgo resolver doesn't pthread_cancel getnameinfo threads, so not // bothering with pointless contexts. - ch := make(chan string) + ch := make(chan string, 1) go func() { defer close(ch) if names, err := net.LookupAddr(host); err != nil { -- cgit v1.2.3-70-g09d2