mirror of
https://github.com/golang/go
synced 2024-11-18 06:24:47 -07:00
cmd/pprof/internal/profile: fix missing error check
Fix missing error check. Spotted by Gordon Klass, https://groups.google.com/forum/#!topic/golang-nuts/MdDLbvOjb4o Change-Id: I453a0cf032e0077d2622d5b85030310d159b9c4b Reviewed-on: https://go-review.googlesource.com/10606 Reviewed-by: Nigel Tao <nigeltao@golang.org>
This commit is contained in:
parent
26301b6cfd
commit
1831e1ec37
@ -125,11 +125,11 @@ func Parse(r io.Reader) (*Profile, error) {
|
||||
|
||||
var p *Profile
|
||||
if len(orig) >= 2 && orig[0] == 0x1f && orig[1] == 0x8b {
|
||||
var data []byte
|
||||
|
||||
if gz, err := gzip.NewReader(bytes.NewBuffer(orig)); err == nil {
|
||||
data, err = ioutil.ReadAll(gz)
|
||||
gz, err := gzip.NewReader(bytes.NewBuffer(orig))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("decompressing profile: %v", err)
|
||||
}
|
||||
data, err := ioutil.ReadAll(gz)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("decompressing profile: %v", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user