diff --git a/src/video/windows/SDL_windowsmouse.c b/src/video/windows/SDL_windowsmouse.c index 19977e214..d1f7e4173 100644 --- a/src/video/windows/SDL_windowsmouse.c +++ b/src/video/windows/SDL_windowsmouse.c @@ -175,11 +175,13 @@ WIN_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) static SDL_Cursor * WIN_CreateBlankCursor() { + SDL_Cursor *cursor = NULL; SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormat(0, 32, 32, 32, SDL_PIXELFORMAT_ARGB8888); if (surface) { - return WIN_CreateCursor(surface, 0, 0); + cursor = WIN_CreateCursor(surface, 0, 0); + SDL_FreeSurface(surface); } - return NULL; + return cursor; } static SDL_Cursor *