title: fclose() then free()?
body: <p>Assume I have the following program:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main () {
      FILE * pFile;
      pFile = fopen ("myfile.txt","r");
  
      fclose (pFile);
      //This never happens: free(pFile)
      return 0;
  }
  </code></pre>
  
  <p>I have never seen a program which does <code>free(pFile)</code> after closing the file handle. Why is that?</p>
  
  <p>I know that since <code>fclose()</code> doesn't receive a pointer to <code>pFile</code>, then it doesn't actually free the pointer's memory. I was under the impression that pointers should always have their memory freed if they are pointing to dynamically allocated memory. Why doesn't anyone <code>free()</code> the file pointer?</p>