title: free() on stack memory
body: <p>I'm supporting some c code on Solaris, and I've seen something weird at least I think it is:</p>
  
  <pre><code>char new_login[64];
  ...
  strcpy(new_login, (char *)login);
  ...
  free(new_login);
  </code></pre>
  
  <p>My understanding is that since the variable is a local array the memory comes from the stack and does not need to be freed, and moreover since no malloc/calloc/realloc was used the behaviour is undefined.</p>
  
  <p>This is a real-time system so I think it is a waste of cycles.  Am I missing something obvious?  </p>