mirror of
https://github.com/golang/go
synced 2024-11-19 13:34:45 -07:00
cmd/pprof: fix crash with invalid source
pprof crashed when running with: go tool pprof %INVALID Change-Id: I47c2a4da7273e3a97a833f320a650b8c6b59d6b9 Reviewed-on: https://go-review.googlesource.com/20632 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
af1c29c1c1
commit
69f49e1cbc
@ -139,7 +139,7 @@ func adjustURL(source string, sec int, ui plugin.UI) (adjusted, host string, dur
|
||||
if err != nil || (url.Host == "" && url.Scheme != "" && url.Scheme != "file") {
|
||||
url, err = url.Parse("http://" + source)
|
||||
if err != nil {
|
||||
return source, url.Host, time.Duration(30) * time.Second
|
||||
return source, "", 0
|
||||
}
|
||||
}
|
||||
if scheme := strings.ToLower(url.Scheme); scheme == "" || scheme == "file" {
|
||||
|
Loading…
Reference in New Issue
Block a user