proc/native/windows: when there is an error during Attach dbp might be nil
This commit is contained in:
parent
edf4cebe25
commit
2497caea4a
@ -163,7 +163,9 @@ func Attach(pid int) (*Process, error) {
|
|||||||
}
|
}
|
||||||
dbp, err := newDebugProcess(New(pid), exepath)
|
dbp, err := newDebugProcess(New(pid), exepath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if dbp != nil {
|
||||||
dbp.Detach(false)
|
dbp.Detach(false)
|
||||||
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return dbp, nil
|
return dbp, nil
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user