From f62bc842ae0a01b89b13779ce6320286fef2e10d Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sat, 24 Aug 2019 18:23:54 -0500 Subject: [PATCH] fix memory leak in session nonce map --- src/yggdrasil/session.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yggdrasil/session.go b/src/yggdrasil/session.go index 7cd92db..6f6a96a 100644 --- a/src/yggdrasil/session.go +++ b/src/yggdrasil/session.go @@ -32,7 +32,7 @@ func (h *nonceHeap) Pop() interface{} { n, *h = (*h)[l-1], (*h)[:l-1] return n } -func (h nonceHeap) peek() *crypto.BoxNonce { return &h[len(h)-1] } +func (h nonceHeap) peek() *crypto.BoxNonce { return &h[0] } // All the information we know about an active session. // This includes coords, permanent and ephemeral keys, handles and nonces, various sorts of timing information for timeout and maintenance, and some metadata for the admin API.