Skip to content

Commit dcf932c

Browse files
authored
fix: close res body
1 parent b711325 commit dcf932c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

internal/itorrents/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ func (c client) Get(ctx context.Context, hash20 protocol.ID) (metainfo.TorrentFi
6161
if resErr != nil {
6262
return metainfo.TorrentFile{}, fmt.Errorf("failed to request torrent file: %w", reqErr)
6363
}
64+
defer res.Body.Close()
6465
if res.StatusCode != http.StatusOK {
6566
return metainfo.TorrentFile{}, fmt.Errorf("response status was not OK requesting torrent file: %s", res.Status)
6667
}

0 commit comments

Comments
 (0)