diff options
author | avg <avg@FreeBSD.org> | 2011-08-03 09:55:59 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2011-08-03 09:55:59 +0000 |
commit | c19f42911878cf5a20e25a68c6204e1972714a53 (patch) | |
tree | 189f3128b04b34afcf046314355b13098496dc1e /lib/libproc | |
parent | 09d3eb129e888c8708ab6df459f85687b7db9c32 (diff) | |
download | FreeBSD-src-c19f42911878cf5a20e25a68c6204e1972714a53.zip FreeBSD-src-c19f42911878cf5a20e25a68c6204e1972714a53.tar.gz |
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
Diffstat (limited to 'lib/libproc')
-rw-r--r-- | lib/libproc/proc_create.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libproc/proc_create.c b/lib/libproc/proc_create.c index c372a47..9bd24a2 100644 --- a/lib/libproc/proc_create.c +++ b/lib/libproc/proc_create.c @@ -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); } |