While using pthread_key_create() to prepare a key to be used by various threads to maintain thread specific data, ensure that the thread specific data stored for a key is cleaned up while when the thread finishes exits otherwise there could be potential memory leaks or misuse of data.
...