Skip to content

Commit

Permalink
Fix missing closed HTTP Body
Browse files Browse the repository at this point in the history
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
  • Loading branch information
wzshiming committed Jun 28, 2022
1 parent b76544b commit 0a240ff
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmd/ctr/commands/pprof/pprof.go
Original file line number Diff line number Diff line change
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 0a240ff

Please sign in to comment.