Skip to content

Commit b44f3a0

Browse files
authored
fix: Missing err check that led to segfault (cyrilgdn#242)
cf cyrilgdn#183
1 parent ec9a057 commit b44f3a0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

postgresql/resource_postgresql_database.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ func createDatabase(db *DBConnection, d *schema.ResourceData) error {
125125
// Take a lock on db currentUser to avoid multiple database creation at the same time
126126
// It can fail if they grant the same owner to current at the same time as it's not done in transaction.
127127
lockTxn, err := startTransaction(db.client, "")
128+
if err != nil {
129+
return err
130+
}
128131
if err := pgLockRole(lockTxn, currentUser); err != nil {
129132
return err
130133
}

0 commit comments

Comments
 (0)