From 8eadf18e015981dd8a11e4ce661e6fc2b5388a2e Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 28 Jun 2021 15:44:20 +0300 Subject: [PATCH] [#607] services/control: Fix incorrect allocation in NetmapSnapshot Fix make with length + subsequent append. Signed-off-by: Leonard Lyubich --- pkg/services/control/server/netmap_snapshot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/control/server/netmap_snapshot.go b/pkg/services/control/server/netmap_snapshot.go index 4c55cf1e2..19250d65e 100644 --- a/pkg/services/control/server/netmap_snapshot.go +++ b/pkg/services/control/server/netmap_snapshot.go @@ -54,7 +54,7 @@ func nodesFromAPI(apiNodes netmapAPI.Nodes) []*control.NodeInfo { node := new(control.NodeInfo) node.SetPublicKey(apiNode.PublicKey()) - addrs := make([]string, apiNode.NumberOfAddresses()) + addrs := make([]string, 0, apiNode.NumberOfAddresses()) netmapAPI.IterateAllAddresses(apiNode.NodeInfo, func(s string) { addrs = append(addrs, s) })