title: Leak caused by fread
body: <p>I'm profiling code of a game I wrote and I'm wondering how it is possible that the following snippet causes an heap increase of 4kb (I'm profiling with Heapshot Analysis of Xcode) every time it is executed:</p>
  
  <pre><code>u8 WorldManager::versionOfMap(FILE *file)
  {
    char magic[4];
    u8 version;
  
    fread(magic, 4, 1, file); &lt;-- this is the line
    fread(&amp;version,1,1,file);
    fseek(file, 0, SEEK_SET);
  
    return version;
  }
  </code></pre>
  
  <p>According to the profiler the highlighted line allocates 4.00Kb of memory with a <code>malloc</code> every time the function is called, memory which is never released. This thing seems to happen with other calls to <code>fread</code> around the code, but this was the most eclatant one.</p>
  
  <p>Is there anything trivial I'm missing? Is it something internal I shouldn't care about?</p>
  
  <p>Just as a note: I'm profiling it on an iPhone and it's compiled as release (<code>-O2</code>).</p>