From 80739547ecc6cddc5c988665ef892c1fcc3fe312 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Mon, 27 Mar 2017 21:23:06 -0400 Subject: [PATCH] Don't pass reference to mutable slice Signed-off-by: Brian Goff Upstream-commit: d5b7839008f80a82063869c43ee197a3b6781ca3 Component: engine --- components/engine/pkg/registrar/registrar.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/engine/pkg/registrar/registrar.go b/components/engine/pkg/registrar/registrar.go index 1e75ee995b..803b0d3c9b 100644 --- a/components/engine/pkg/registrar/registrar.go +++ b/components/engine/pkg/registrar/registrar.go @@ -98,7 +98,12 @@ func (r *Registrar) GetNames(key string) ([]string, error) { if !exists { return nil, ErrNoSuchKey } - return names, nil + + ls := make([]string, 0, len(names)) + for _, n := range names { + ls = append(ls, n) + } + return ls, nil } // Get returns the key that the passed in name is reserved to