From 6fe15d6347e993946dbff7beaf516f1e6a7079b2 Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Wed, 16 Nov 2016 22:09:40 +0100 Subject: [PATCH] Wayland: Fixed memory leak if output retrieval failed. Found by Cppcheck. --- src/video/wayland/SDL_waylandvideo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index 0caa14039ea40..ab9aabe8fa151 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; }