mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 19:38:14 +00:00
wayland: Free the scaled cursor surface if SHM allocation fails
This commit is contained in:
@@ -466,8 +466,8 @@ static Wayland_CachedCustomCursor *Wayland_GetCachedCustomCursor(SDL_Cursor *cur
|
|||||||
|
|
||||||
/* Allocate shared memory buffer for this cursor */
|
/* Allocate shared memory buffer for this cursor */
|
||||||
if (Wayland_AllocSHMBuffer(surface->w, surface->h, &cache->shmBuffer) != 0) {
|
if (Wayland_AllocSHMBuffer(surface->w, surface->h, &cache->shmBuffer) != 0) {
|
||||||
SDL_free(cursor->internal);
|
SDL_free(cache);
|
||||||
SDL_free(cursor);
|
SDL_DestroySurface(surface);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user