mirror of
https://github.com/golang/go
synced 2024-11-15 03:20:31 -07:00
cmd/pprof: close resp body after the profile.Parse is called
Change-Id: I5bccef3c46072e388bfe9985e70745853f673a42
GitHub-Last-Rev: adee7b9f7f
GitHub-Pull-Request: golang/go#66829
Reviewed-on: https://go-review.googlesource.com/c/go/+/578875
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
c71d2a8d8f
commit
8e987fadb5
@ -84,8 +84,8 @@ func getProfile(source string, timeout time.Duration) (*profile.Profile, error)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
defer resp.Body.Close()
|
||||
return nil, statusCodeError(resp)
|
||||
}
|
||||
return profile.Parse(resp.Body)
|
||||
|
Loading…
Reference in New Issue
Block a user