From c19f42911878cf5a20e25a68c6204e1972714a53 Mon Sep 17 00:00:00 2001 From: avg Date: Wed, 3 Aug 2011 09:55:59 +0000 Subject: 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 --- lib/libproc/proc_create.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/libproc') 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); } -- cgit v1.1