title: About possible chain reactions of free() in C' stdlib.h
body: <pre><code>#include &lt;stdlib.h&gt;
  
  struct strt;
  typedef struct {
      int i;
      struct strt *next;
  } strt;
  
  strt *s1 = malloc(sizeof(strt));
  strt *s2=s1-&gt;next = malloc(sizeof(strt));
  
  free(s1);
  </code></pre>
  
  <p>Now, does <code>free(s1)</code> deallocate the block pointed to by s1 only or those pointed to by s1 <strong>and</strong> s1->next/s2?</p>
  
  <p>I understand this must be a question asked a thousand times, but I 
  couldn't manage to describe this the the search engine, neither could
  I find direct mention of the same issue in documentation of the <code>free()</code> function.</p>