diff --git a/uasc/secure_channel.go b/uasc/secure_channel.go index 4ee74d4f..918e5480 100644 --- a/uasc/secure_channel.go +++ b/uasc/secure_channel.go @@ -626,6 +626,7 @@ func (s *SecureChannel) scheduleExpiration(instance *channelInstance) { debug.Printf("uasc %d: security token expires at %s. channelID=%d tokenID=%d", s.c.ID(), when.UTC().Format(time.RFC3339), instance.secureChannelID, instance.securityTokenID) t := time.NewTimer(time.Until(when)) + defer t.Stop() select { case <-s.closing: