From 3a43c43ac8a996b8c1093e517ffc764ba0f2ab94 Mon Sep 17 00:00:00 2001 From: hex0punk Date: Mon, 26 Apr 2021 17:22:46 -0700 Subject: [PATCH] prevents a goroutine from being leaked if a timeout occurs when calling forceCloseConnection --- agent/wsclient/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/wsclient/client.go b/agent/wsclient/client.go index df350b0a5c0..0c67841a64f 100644 --- a/agent/wsclient/client.go +++ b/agent/wsclient/client.go @@ -265,7 +265,7 @@ func (cs *ClientServerImpl) SetReadDeadline(t time.Time) error { } func (cs *ClientServerImpl) forceCloseConnection() { - closeChan := make(chan error) + closeChan := make(chan error, 1) go func() { closeChan <- cs.Close() }()