mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
database/sql: fix Conn leak
Fixes #4902 R=golang-dev, alex.brainman, r, google CC=golang-dev https://golang.org/cl/7579045
This commit is contained in:
parent
1a4599b41a
commit
3cdf8bae1a
2 changed files with 30 additions and 0 deletions
|
|
@ -445,6 +445,7 @@ func (db *DB) prepare(query string) (*Stmt, error) {
|
|||
css: []connStmt{{ci, si}},
|
||||
}
|
||||
db.addDep(stmt, stmt)
|
||||
db.putConn(ci, nil)
|
||||
return stmt, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue