Fixed bug 5121 - Use SDL_calloc instead of calloc in Wayland_CreateWindow
authorSam Lantinga
Mon, 04 May 2020 13:19:26 -0700
changeset 13790fdabcc76aaaf
parent 13789 a359f4f93439
child 13791 c53bc3314e83
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'.
src/video/wayland/SDL_waylandwindow.c
     1.1 --- a/src/video/wayland/SDL_waylandwindow.c	Mon May 04 13:17:43 2020 -0700
     1.2 +++ b/src/video/wayland/SDL_waylandwindow.c	Mon May 04 13:19:26 2020 -0700
     1.3 @@ -634,7 +634,7 @@
     1.4      SDL_VideoData *c;
     1.5      struct wl_region *region;
     1.6  
     1.7 -    data = calloc(1, sizeof *data);
     1.8 +    data = SDL_calloc(1, sizeof *data);
     1.9      if (data == NULL)
    1.10          return SDL_OutOfMemory();
    1.11