فهرست منبع

wayland: Free the scaled cursor surface if SHM allocation fails

Frank Praznik 1 سال پیش
والد
کامیت
10abe1a75b
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      src/video/wayland/SDL_waylandmouse.c

+ 2 - 2
src/video/wayland/SDL_waylandmouse.c

@@ -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;
     }