Sfoglia il codice sorgente

lib/connections: Correct race on loop variable (fixes #8320) (#8321)

Jakob Borg 3 anni fa
parent
commit
ce0ded7c78
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      lib/connections/service.go

+ 1 - 1
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()