Adds missing unlock of RWMutex in OIDC delete key (#12916)

This commit is contained in:
Austin Gebauer 2021-10-25 09:59:26 -07:00 committed by GitHub
parent 95e5cdd000
commit a25cfe822e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

3
changelog/12916.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
identity/token: Adds missing call to unlock mutex in key deletion error handling
```

View File

@ -703,6 +703,7 @@ func (i *IdentityStore) pathOIDCDeleteKey(ctx context.Context, req *logical.Requ
roleNames, err := i.roleNamesReferencingTargetKeyName(ctx, req, targetKeyName)
if err != nil {
i.oidcLock.Unlock()
return nil, err
}
@ -715,6 +716,7 @@ func (i *IdentityStore) pathOIDCDeleteKey(ctx context.Context, req *logical.Requ
clientNames, err := i.clientNamesReferencingTargetKeyName(ctx, req, targetKeyName)
if err != nil {
i.oidcLock.Unlock()
return nil, err
}