title: Why does malloc not work sometimes?
body: <p>I'm porting a C project from Linux to Windows. On Linux it is completely stable. On Windows, it's working well most times, but sometimes I got a segmentation fault.</p>
  
  <p>I'm using Microsoft Visual Studio 2010 to compile and debug and looks like sometimes my malloc calls simply doesn't allocate memory, returning NULL. The machine has free memory; it already passed through that code a thousand times, but it still happens in different locations.</p>
  
  <p>Like I said, it doesn't happen all the time or in the same location; it looks like a random error.</p>
  
  <p>Is there something I have to be more careful on Windows than on Linux? What can I be doing wrong?</p>