fix: ensure rows are closed (#670)

Former-commit-id: 85c8e47016
This commit is contained in:
Hayden 2023-12-15 21:07:17 -06:00 committed by GitHub
parent 0c535aa8d8
commit 1cc9bf459a

View file

@ -135,6 +135,7 @@ func (r *LocationRepository) GetAll(ctx context.Context, GID uuid.UUID, filter L
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer rows.Close()
list := []LocationOutCount{} list := []LocationOutCount{}
for rows.Next() { for rows.Next() {
@ -285,6 +286,7 @@ func (lr *LocationRepository) PathForLoc(ctx context.Context, GID, locID uuid.UU
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer rows.Close()
var locations []LocationPath var locations []LocationPath