Skip to content

Commit

Permalink
(Fixed #160) Add mutex.lock to common missing use memory
Browse files Browse the repository at this point in the history
  • Loading branch information
hahwul committed Jan 8, 2021
1 parent f331155 commit 7cbf962
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/scanning/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7cbf962

Please sign in to comment.