Răsfoiți Sursa

Fixed bug 5121 - Use SDL_calloc instead of calloc in Wayland_CreateWindow

meyraud705

'SDL_Windows::driverdata' of a Wayland window is allocated by calloc in 'Wayland_CreateWindow' but freed by SDL_free in 'Wayland_DestroyWindow'.
Sam Lantinga 5 ani în urmă
părinte
comite
0eb6512b53
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      src/video/wayland/SDL_waylandwindow.c

+ 1 - 1
src/video/wayland/SDL_waylandwindow.c

@@ -634,7 +634,7 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window)
     SDL_VideoData *c;
     struct wl_region *region;
 
-    data = calloc(1, sizeof *data);
+    data = SDL_calloc(1, sizeof *data);
     if (data == NULL)
         return SDL_OutOfMemory();