fix malloc compile error for mingw