fix for Windows build (free is NULL safe on Windows)