Commit 4183211a544b3a4e7c8c3222c223527fa17c1812

Christian Rauch 2021-02-08T16:01:37

free the 'display' after it was added to global list

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c
index 3ddeef0..08d6921 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