mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00: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
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue