From 0a240ff81193d67eb86bae537492ba64e42710af Mon Sep 17 00:00:00 2001 From: Shiming Zhang Date: Tue, 28 Jun 2022 14:47:26 +0800 Subject: [PATCH] Fix missing closed HTTP Body Signed-off-by: Shiming Zhang --- cmd/ctr/commands/pprof/pprof.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/ctr/commands/pprof/pprof.go b/cmd/ctr/commands/pprof/pprof.go index 1eafcf29abea..52a42e696f49 100644 --- a/cmd/ctr/commands/pprof/pprof.go +++ b/cmd/ctr/commands/pprof/pprof.go @@ -182,6 +182,7 @@ func httpGetRequest(client *http.Client, request string) (io.ReadCloser, error) return nil, err } if resp.StatusCode != 200 { + resp.Body.Close() return nil, fmt.Errorf("http get failed with status: %s", resp.Status) } return resp.Body, nil