title: Will pthread_detach manage my memory for me?
body: <p>Suppose I have the following code:</p>
  
  <pre><code>while(TRUE) {
    pthread_t *thread = (pthread_t *) malloc(sizeof(pthread_t));
    pthread_create(thread, NULL, someFunction, someArgument);
    pthread_detach(*thread);
    sleep(10);
  }
  </code></pre>
  
  <p>Will the detached thread free the memory allocated by malloc, or is that something I now have to do?</p>