mirror of
https://github.com/shirou/gopsutil.git
synced 2025-04-26 13:48:59 +08:00
Merge pull request #1033 from eriknordmark/erik-reduce-memory
Avoid returning slice into buffer from Readfile
This commit is contained in:
commit
a5834f48c4
@ -821,8 +821,12 @@ func (p *Process) fillFromStatusWithContext(ctx context.Context) error {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Ensure we have a copy and not reference into slice
|
||||
p.name = string([]byte(p.name))
|
||||
case "State":
|
||||
p.status = value[0:1]
|
||||
// Ensure we have a copy and not reference into slice
|
||||
p.status = string([]byte(p.status))
|
||||
case "PPid", "Ppid":
|
||||
pval, err := strconv.ParseInt(value, 10, 32)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user