Skip to content

Commit

Permalink
Merge pull request containerd#7107 from wzshiming/fix/close-http-body
Browse files Browse the repository at this point in the history
Fix missing closed HTTP Body
  • Loading branch information
estesp committed Jun 28, 2022
2 parents b76544b + 0a240ff commit 36bd4a5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmd/ctr/commands/pprof/pprof.go
Expand Up @@ -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
Expand Down

0 comments on commit 36bd4a5

Please sign in to comment.