title: glibc detect smallbin linked list corrupted
body: <p>I am trying to run a function repeatedly in a large loop but I get an error after 2 or 3 iterations but if I start from the point it gave an error it works fine but again stops after 3 4 iteration. It might be a memory problem. As the function is quite large I am not sure where exactly there is a memory leakage. Is there anyway I can free the variables after each iteration or something that can solve this problem. Or as it is a linked list memory problem free all the linked list or something?What can be the solution? The problrm does not happen if I run the function once so I think it is because I am calling the function repeatedly in a loop. Is there any way to solve this problem? </p>
  
  <p>The error is</p>
  
  <pre><code>**glibc detected:.....malloc():smallbin double linked list corrupted: 0x000000000 1d404c0 ***
  </code></pre>