secret/database: ensure plugins are closed if they cannot be initialized (#3768)

This commit is contained in:
Brian Kassouf
2018-01-09 13:14:50 -08:00
committed by GitHub
parent c9e5cd5433
commit 05f20305b2
2 changed files with 13 additions and 1 deletions

View File

@@ -233,7 +233,6 @@ func (b *databaseBackend) connectionWriteHandler() framework.OperationFunc {
err = db.Initialize(ctx, config.ConnectionDetails, verifyConnection)
if err != nil {
db.Close()
return logical.ErrorResponse(fmt.Sprintf("error creating database object: %s", err)), nil
}