From e841fc08264ad11679bc0ac7458fde87cd201e45 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 10 Dec 2005 20:41:44 +0000 Subject: [PATCH] (lwpNewContext) [UCONTEXT]: Fix the previous revision. --- src/lib/lwp/arch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/lwp/arch.c b/src/lib/lwp/arch.c index 8be384d3..222e7d34 100644 --- a/src/lib/lwp/arch.c +++ b/src/lib/lwp/arch.c @@ -73,8 +73,10 @@ lwpNewContext(struct lwpProc *newp, int stacksz) newp->ustack = s + redsize; newp->usize = stacksz; - if (getcontext(&newp->context) < 0) + if (getcontext(&newp->context) < 0) { + free(s); return -1; + } newp->context.uc_stack.ss_sp = newp->ustack; newp->context.uc_stack.ss_size = newp->usize; newp->context.uc_stack.ss_flags = 0;