Skip to content

Find, verify, and analyze leaked credentials

[bug] - Fix unlocking an unlocked mutex (#1583)

ahrav5043fc87566b
diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go
index b4fda8918..68c912d17 100644
--- a/pkg/engine/engine.go
+++ b/pkg/engine/engine.go
@@ -176,10 +176,6 @@ func filterDetectors(filterFunc func(detectors.Detector) bool, input []detectors
return output
}
-func (e *Engine) setFoundResults() {
- atomic.StoreUint32(&e.numFoundResults, 1)
-}
-
// HasFoundResults returns true if any results are found.
func (e *Engine) HasFoundResults() bool {
return atomic.LoadUint32(&e.numFoundResults) > 0
diff --git a/pkg/sources/github/repo.go b/pkg/sources/github/repo.go
index c0c7709d0..502a89797 100644
--- a/pkg/sources/github/repo.go
+++ b/pkg/sources/github/repo.go
@@ -65,7 +65,7 @@ func (s *Source) cloneRepo(
func (s *Source) getUserAndToken(ctx context.Context, repoURL string, installationClient *github.Client) error {
// We never refresh user provided tokens, so if we already have them, we never need to try and fetch them again.
s.userMu.Lock()
- defer s.mu.Unlock()
+ defer s.userMu.Unlock()
if s.githubUser == "" || s.githubToken == "" {
var err error
s.githubUser, s.githubToken, err = s.userAndToken(ctx, installationClient)