title: How to properly free a malloc'd structure?
body: <p>Let's say I have a malloc'd struct with certain fields:</p>
  
  <pre><code>typedef struct myStruct {
      int integer;
      char* array;
      ...
      }
  </code></pre>
  
  <p>I malloc an array of this structs but, when I want to free them, should I just:</p>
  
  <pre><code>/* Loop */
  free(myStruct[i])
  myStruct[i] = NULL
  
  free(myStruct)
  </code></pre>
  
  <p>Or should I free every field of the structure, and then the struct itself?</p>