libfic: fix a potential memory/SQL connection leak
This commit is contained in:
parent
024ae04f45
commit
891b2ea6bf
|
@ -252,6 +252,8 @@ func (t Team) GetSolvedRank(e Exercice) (nb int64, err error) {
|
|||
if rows, errr := DBQuery("SELECT id_team FROM exercice_solved WHERE id_exercice = ? ORDER BY time ASC", e.Id); err != nil {
|
||||
return nb, errr
|
||||
} else {
|
||||
defer rows.Close()
|
||||
|
||||
for rows.Next() {
|
||||
var tid int64
|
||||
if err = rows.Scan(&tid); err != nil {
|
||||
|
|
Loading…
Reference in New Issue