Skip to content

Commit

Permalink
fix: Missing err check that led to segfault (#242)
Browse files Browse the repository at this point in the history
cf #183
  • Loading branch information
cyrilgdn authored Aug 19, 2022
1 parent ec9a057 commit b44f3a0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions postgresql/resource_postgresql_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ func createDatabase(db *DBConnection, d *schema.ResourceData) error {
// Take a lock on db currentUser to avoid multiple database creation at the same time
// It can fail if they grant the same owner to current at the same time as it's not done in transaction.
lockTxn, err := startTransaction(db.client, "")
if err != nil {
return err
}
if err := pgLockRole(lockTxn, currentUser); err != nil {
return err
}
Expand Down

0 comments on commit b44f3a0

Please sign in to comment.