From ce0ded7c780d0e1acc3e6f380410d2eddec016ad Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 4 May 2022 18:16:36 +0200 Subject: [PATCH] lib/connections: Correct race on loop variable (fixes #8320) (#8321) --- lib/connections/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/connections/service.go b/lib/connections/service.go index 1404b9635..ace5dd0c4 100644 --- a/lib/connections/service.go +++ b/lib/connections/service.go @@ -228,8 +228,8 @@ func NewService(cfg config.Wrapper, myID protocol.DeviceID, mdl Model, tlsCfg *t } func (s *service) handleConns(ctx context.Context) error { - var c internalConn for { + var c internalConn select { case <-ctx.Done(): return ctx.Err()