Commit 6fe15d6347e993946dbff7beaf516f1e6a7079b2

Philipp Wiesemann 2016-11-16T22:09:40

Wayland: Fixed memory leak if output retrieval failed. Found by Cppcheck.

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c
index 0caa140..ab9aabe 100644
--- a/src/video/wayland/SDL_waylandvideo.c
+++ b/src/video/wayland/SDL_waylandvideo.c
@@ -271,6 +271,7 @@ Wayland_add_display(SDL_VideoData *d, uint32_t id)
     output = wl_registry_bind(d->registry, id, &wl_output_interface, 2);
     if (!output) {
         SDL_SetError("Failed to retrieve output.");
+        SDL_free(display);
         return;
     }