wayland: Free the scaled cursor surface if SHM allocation fails

This commit is contained in:
Frank Praznik committed 2024-08-06 11:15:15 -04:00
1 parent 57fa3bc08e
commit 10abe1a75b
1 file changed
+2 -2
+2 -2
View File
@@ -466,8 +466,8 @@ static Wayland_CachedCustomCursor *Wayland_GetCachedCustomCursor(SDL_Cursor *cur
/* Allocate shared memory buffer for this cursor */
if (Wayland_AllocSHMBuffer(surface->w, surface->h, &cache->shmBuffer) != 0) {
SDL_free(cursor->internal);
SDL_free(cursor);
SDL_free(cache);
SDL_DestroySurface(surface);
return NULL;
}