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

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 // Add the % wildcard to the prefix to do the prefix search
likePrefix := prefix + "%" likePrefix := prefix + "%"
rows, err := m.statements["list"].Query(likePrefix) rows, err := m.statements["list"].Query(likePrefix)
if err != nil {
return nil, err
}
defer rows.Close()
var keys []string var keys []string
for rows.Next() { for rows.Next() {