Fix memory leaks and heap buffer overflow in test_thread-pool.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user