Compare commits

...

1 Commits

Author SHA1 Message Date
James Tucker 0fd6bf0a1c
wgengine/magicsock: ensure that an existing timer is stopped
There presently is not a bug here, but this is a time-bomb waiting for
an innocent incremental change to accidentally adjust the parent call
chain resulting in a timer leak.

Updates #cleanup
Signed-off-by: James Tucker <james@tailscale.com>
2023-06-16 14:54:53 -07:00
1 changed files with 4 additions and 1 deletions

View File

@ -4441,7 +4441,10 @@ func (de *endpoint) heartbeat() {
de.mu.Lock()
defer de.mu.Unlock()
de.heartBeatTimer = nil
if de.heartBeatTimer != nil {
de.heartBeatTimer.Stop()
de.heartBeatTimer = nil
}
if de.heartbeatDisabled {
// If control override to disable heartBeatTimer set, return early.