From 09987ba4ce8f9befae910f740e8034ff6bdeddf6 Mon Sep 17 00:00:00 2001 From: marco Date: Tue, 30 Apr 2024 16:18:01 +0200 Subject: [PATCH] fix "range-loop variables always have the same address" --- cmd/crowdsec/output.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/crowdsec/output.go b/cmd/crowdsec/output.go index ac05b502e..96559727e 100644 --- a/cmd/crowdsec/output.go +++ b/cmd/crowdsec/output.go @@ -26,11 +26,12 @@ func dedupAlerts(alerts []types.RuntimeAlert) ([]*models.Alert, error) { continue } - for k, src := range alert.Sources { + for k := range alert.Sources { refsrc := *alert.Alert // copy log.Tracef("source[%s]", k) + src := alert.Sources[k] refsrc.Source = &src dedupCache = append(dedupCache, &refsrc) }