Commit bbb797067f8603806e2b0c7c80549891e170ca71

Con Kolivas 2013-05-19T19:34:12

Check for *pth dereference on pthread_join

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/cgminer.c b/cgminer.c
index 607ae80..d65647f 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2810,7 +2810,7 @@ static void __kill_work(void)
 		if (thr && PTH(thr) != 0L)
 			pth = &thr->pth;
 		thr_info_cancel(thr);
-		if (pth)
+		if (pth && *pth)
 			pthread_join(*pth, NULL);
 	}