fix: ensure rows are closed (#670)

This commit is contained in:
Hayden 2023-12-15 21:07:17 -06:00 committed by GitHub
parent 8538877f52
commit 85c8e47016
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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