From f65c3a961a9862aa95b34c56633e20a0818a8218 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Sun, 26 Sep 2021 13:38:28 -0400 Subject: [PATCH] internal/gitfs: close response body in Repo.handshake This was missed in CL 328213. Change-Id: If62b9ee842b4b89725915ae74f755e66073264bd Reviewed-on: https://go-review.googlesource.com/c/website/+/352329 Auto-Submit: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov Reviewed-by: Carlos Amedee LUCI-TryBot-Result: Go LUCI Reviewed-by: Rhys Hiltner --- internal/gitfs/git.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/gitfs/git.go b/internal/gitfs/git.go index 06325b26..7cf1c5c0 100644 --- a/internal/gitfs/git.go +++ b/internal/gitfs/git.go @@ -41,6 +41,7 @@ func (r *Repo) handshake() error { if err != nil { return fmt.Errorf("handshake: %v", err) } + defer resp.Body.Close() data, err := io.ReadAll(resp.Body) if resp.StatusCode != 200 { return fmt.Errorf("handshake: %v\n%s", resp.Status, data)