Fix memory leaks and heap buffer overflow in test_thread-pool.

This commit is contained in:
Bartosz Podrygajlo
2024-06-27 18:35:43 +02:00
parent 5af81bbc9d
commit 9724ff0329
2 changed files with 15 additions and 3 deletions
+3 -1
View File
@@ -336,7 +336,9 @@ static inline int abortTpool(tpool_t *t) {
thread = t->allthreads;
while (thread != NULL) {
pthread_cancel(thread->threadID);
thread = thread->next;
struct one_thread *next = thread->next;
free(thread);
thread = next;
}
return nbRemoved;