diff --git a/pkg/detectors/ldap/ldap.go b/pkg/detectors/ldap/ldap.go index 4685d781e7d3..fb5fd15df687 100644 --- a/pkg/detectors/ldap/ldap.go +++ b/pkg/detectors/ldap/ldap.go @@ -65,10 +65,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result } if verify { - err := verifyLDAP(username[1], password[1], ldapURL) - s1.Verified = err == nil - if !isErrDeterminate(err) { - s1.VerificationError = err + verificationErr := verifyLDAP(username[1], password[1], ldapURL) + s1.Verified = verificationErr == nil + if !isErrDeterminate(verificationErr) { + s1.VerificationError = verificationErr } }