From c24c62be66b5e781c39faa5ea71cfa461d97f1dd Mon Sep 17 00:00:00 2001 From: ucwong Date: Fri, 21 Jul 2023 14:40:18 +0800 Subject: [PATCH] cmd/bootnode: timer leak fix --- cmd/bootnode/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/bootnode/main.go b/cmd/bootnode/main.go index bddfcbe2a5e0..14f030ff5e75 100644 --- a/cmd/bootnode/main.go +++ b/cmd/bootnode/main.go @@ -196,6 +196,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)