From 344540e22de2353e3b8124589767568bdbc4b811 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Sat, 6 Feb 2021 23:34:36 +0000 Subject: [PATCH] free the 'display' after it was added to global list --- src/video/wayland/SDL_waylandvideo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index 3ddeef08b..08d69215b 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -297,6 +297,10 @@ display_handle_done(void *data, SDL_AddVideoDisplay(display, SDL_FALSE); SDL_free(display->name); + /* The 'display' content was copied in previous SDL_AddVideoDisplay call. + * We have to remove this reference, else it will be lost indefinitely. + */ + SDL_free(display); } static void -- 2.25.1