From 7cbf9628e3f667a118a9d497fcbc73e927c64756 Mon Sep 17 00:00:00 2001 From: hahwul Date: Sat, 9 Jan 2021 00:18:20 +0900 Subject: [PATCH] (Fixed #160) Add mutex.lock to common missing use memory --- pkg/scanning/scan.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/scanning/scan.go b/pkg/scanning/scan.go index 6808444e..dab933bb 100644 --- a/pkg/scanning/scan.go +++ b/pkg/scanning/scan.go @@ -723,6 +723,7 @@ func ParameterAnalysis(target string, options model.Options) map[string][]string var wgg sync.WaitGroup concurrency := options.Concurrence paramsQue := make(chan string) + mutex := &sync.Mutex{} for i := 0; i < concurrency; i++ { wgg.Add(1) go func() { @@ -761,9 +762,10 @@ func ParameterAnalysis(target string, options model.Options) map[string][]string for k, v := range tempSmap { smap = smap + "/" + k + "(" + strconv.Itoa(v) + ")" } + mutex.Lock() params[k] = append(params[k], smap) + mutex.Unlock() var wg sync.WaitGroup - mutex := &sync.Mutex{} chars := GetSpecialChar() for _, c := range chars { wg.Add(1)