From 343699a7676a72a628aa97c46aeb0706cc4d54ec Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 28 Nov 2014 11:19:20 +1100 Subject: [PATCH] Add sanity checks in pthread cancels/joins --- src/ckpool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ckpool.c b/src/ckpool.c index e089ace7..13d10479 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -865,7 +865,7 @@ static void clean_up(ckpool_t *ckp) static void cancel_join_pthread(pthread_t *pth) { - if (!*pth) + if (!pth || !*pth) return; pthread_cancel(*pth); join_pthread(*pth); @@ -874,7 +874,7 @@ static void cancel_join_pthread(pthread_t *pth) static void cancel_pthread(pthread_t *pth) { - if (!*pth) + if (!pth || !*pth) return; pthread_cancel(*pth); pth = NULL;