Ensure rows.Close() is called in List

This commit is contained in:
Devin Christensen 2016-01-20 17:02:23 -07:00
parent 614f7b7157
commit 65bd200fae
1 changed files with 4 additions and 0 deletions

View File

@ -170,6 +170,10 @@ func (m *PostgreSQLBackend) List(prefix string) ([]string, error) {
// Add the % wildcard to the prefix to do the prefix search
likePrefix := prefix + "%"
rows, err := m.statements["list"].Query(likePrefix)
if err != nil {
return nil, err
}
defer rows.Close()
var keys []string
for rows.Next() {