From a8375da0d32591f81e799a2bcebebc4ba918ed12 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Wed, 3 Aug 2011 09:55:59 +0000 Subject: [PATCH] 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(-) diff --git a/lib/libproc/proc_create.c b/lib/libproc/proc_create.c index c372a4771a9e..9bd24a232b26 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); }