diff --git a/cmd/ctr/commands/pprof/pprof.go b/cmd/ctr/commands/pprof/pprof.go index 1eafcf29a..52a42e696 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