title: malloc in c, struct
body: <p>I made a struct like this:</p>
  
  <pre><code>struct a{
    char *name;
    char *value;
    struct a *next;
  };
  </code></pre>
  
  <p>when I malloc for memory at first time, it's ok, and I can set 'name' and 'value' a corresponding value.
  but when I malloc for the second time, errors come. And It's a cgi, just show me "500 Internal server error".</p>
  
  <p>I changed the pointer 'name' and 'value' to array, everything works. </p>
  
  <p>I thought maybe the complier doesn't know how much memory to assign.</p>
  
  <p>And do you have some ideas with this? I will appreciate every answer!</p>