title: Exception on malloc for a structure in C
body: <p>I have a structure defined like so:</p>
  
  <pre><code>typedef struct {
   int n;
   int *n_p;
   void **list_pp;
   size_t rec_size;
   int n_buffs;
   size_t buff_size
  } fl_hdr_type;
  </code></pre>
  
  <p>and in my code I Have a function for initlialization that has the following</p>
  
  <pre><code>fl_hdr_type *fl_hdr;
  fl_hdr = malloc(sizeof(fl_hdr_type) + (buff_size_n * rec_size_n));
  </code></pre>
  
  <p>where those buffer size are passed in to the function to allow space for the buffers as well. </p>
  
  <p>The size is pretty small typically..100*50 or something like that..plenty of memory on this system to allocate it.
  I can't actually post the stack trace because this code is on another network, but some information pulled from dbx on the core file:</p>
  
  <p>buff_size_n = 32, rec_size_n = 186</p>
  
  <p>and the stack..line numbers from malloc.c</p>
  
  <pre><code> t_splay:861
   t_delete:796
   realfree: 531
   cleanfree:945
   _malloc:230
   _malloc:186
  </code></pre>
  
  <p>Any ideas why this fails?</p>