pthreads
itself leaves a few unfreed but not leaking mallocs behind. Running valgrind --leak-check=full --show-reachable=yes
gives some 'still reachable' bytes lost. This is not a problem. See http://stackoverflow.com/questions/3844678/pthread-exit-vs-return