From 34e4aa8a77948c170a08c2179c09511a0e6c18cf Mon Sep 17 00:00:00 2001 From: guangwu Date: Wed, 22 May 2024 00:26:45 +0800 Subject: [PATCH] fix: close resp body (#404) --- server/torr/utils/torrent.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/torr/utils/torrent.go b/server/torr/utils/torrent.go index d8ac5ca..1e50d3d 100644 --- a/server/torr/utils/torrent.go +++ b/server/torr/utils/torrent.go @@ -63,6 +63,7 @@ func loadNewTracker() { } resp, err := http.Get("https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best_ip.txt") if err == nil { + defer resp.Body.Close() buf, err := io.ReadAll(resp.Body) if err == nil { arr := strings.Split(string(buf), "\n")