mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-01 10:43:32 +00:00
fix a serious bug in libproc's proc_attach
proc_attach always frees any struct proc_handle data that it allocates, but that is supposed to be done only in error conditions. PR: bin/158431 Approved by: re (kib) MFC after: 1 week
This commit is contained in:
parent
52227d94df
commit
a8375da0d3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=224632
@ -79,12 +79,11 @@ proc_attach(pid_t pid, int flags, struct proc_handle **pphdl)
|
||||
else
|
||||
phdl->status = PS_STOP;
|
||||
|
||||
out:
|
||||
if (error)
|
||||
proc_free(phdl);
|
||||
else
|
||||
*pphdl = phdl;
|
||||
out:
|
||||
proc_free(phdl);
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user