remove useless malloc
fix memory leak
only use exports file on win32