WINDOWS: fix memory bug introduced by #3078