From 9d744f0ca841df3dcea05886d985d26a8b75ef70 Mon Sep 17 00:00:00 2001 From: ucwong Date: Tue, 1 Aug 2023 13:12:11 +0100 Subject: [PATCH] cmd/bootnode: fix timer leak (#27754) --- cmd/bootnode/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/bootnode/main.go b/cmd/bootnode/main.go index 9b5a77c6c..5c1635de3 100644 --- a/cmd/bootnode/main.go +++ b/cmd/bootnode/main.go @@ -197,6 +197,7 @@ func doPortMapping(natm nat.Interface, ln *enode.LocalNode, addr *net.UDPAddr) * // Refresh the mapping periodically. go func() { refresh := time.NewTimer(mapTimeout) + defer refresh.Stop() for range refresh.C { addMapping() refresh.Reset(mapTimeout)