From fc29806663f5828dbe12e5f3df57d4498a9aef4b Mon Sep 17 00:00:00 2001 From: Daniel Roethlisberger Date: Sat, 24 Aug 2013 21:44:40 +0200 Subject: [PATCH] Fix off by one error in thrmgr error cleanup code This should remove another potential source of segmentation faults when the thread manager fails to start. Issue: #10 Reported by: linuxton --- pxythrmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pxythrmgr.c b/pxythrmgr.c index d78472f..b7f1216 100644 --- a/pxythrmgr.c +++ b/pxythrmgr.c @@ -163,7 +163,7 @@ leave_thr: pthread_join(ctx->thr[idx]->thr, NULL); idx--; } - idx = ctx->num_thr; + idx = ctx->num_thr - 1; leave: while (idx >= 0) {