On Windows there is no guarantee that "free" is the correct function to use to deallocate an OS-supplied buffer. Typically each API or set of APIs will have its own free-equivalent (but you have to call the correct one, or everything may break). 

Raymond Chen (at the Old New Thing blog) has lots more details: http://blogs.msdn.com/b/oldnewthing/archive/2006/09/15/755966.aspx