Leaking memory with pthreads
I'm using pthreads and according to valgrind I am leaking memory, like in valgrind memory leak errors when using pthread_create The top answer says that if you pthread_join all the threads this memory will be reclaimed, but it isn't for me. pthread_t threads[NUM_THREADS]; ... for (i = 0; i < NUM_THREADS; i++) { pthread_create(&threads[i], &attr, Worker, NULL); } ... for (i = 0; i < NUM_THREADS; i++) { pthread_join(threads[i], NULL); } valgrind output ==2707== HEAP SUMMARY: ==2707== in use at exit: 954 bytes in 4 blocks ==2707== total heap usage: 7,717 allocs, 7,713 frees, 79,563 bytes