diff options
| author | Daniel Theophanes <kardianos@gmail.com> | 2016-10-19 12:26:55 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2016-10-20 08:48:44 +0000 |
| commit | 692df217ca21b6df8e4dc65538fcc90733e8900e (patch) | |
| tree | 72f1d8ac165603de470bbcfa187d6389fd3c6cf8 /src/database/sql/sql.go | |
| parent | 9cefbe9d03918c07451e5512cc4c227fb0d6885a (diff) | |
| download | go-692df217ca21b6df8e4dc65538fcc90733e8900e.tar.xz | |
database/sql: add missing unlock when context is expired
Missing the DB mutex unlock on an early return after checking
if the context has expired.
Fixes #17518
Change-Id: I247cafcef62623d813f534a941f3d5a3744f0738
Reviewed-on: https://go-review.googlesource.com/31494
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/database/sql/sql.go')
| -rw-r--r-- | src/database/sql/sql.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/database/sql/sql.go b/src/database/sql/sql.go index defe960742..d363008993 100644 --- a/src/database/sql/sql.go +++ b/src/database/sql/sql.go @@ -814,6 +814,7 @@ func (db *DB) conn(ctx context.Context, strategy connReuseStrategy) (*driverConn } // Check if the context is expired. if err := ctx.Err(); err != nil { + db.mu.Unlock() return nil, err } lifetime := db.maxLifetime |
