[SDL_Tizen] Modify memory leak
authorhuiyu.eun <huiyu.eun@samsung.com>
Wed, 8 Feb 2017 05:01:02 +0000 (14:01 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Wed, 8 Feb 2017 05:03:23 +0000 (14:03 +0900)
[Svace Issue] Dynamic memory referenced by 'display' was allocated at SDL_malloc.c:36
by calling function 'SDL_malloc_REAL' at SDL_waylandvideo.c:212 and lost at SDL_waylandvideo.c:222.

refer https://www.libsdl.org/tmp/SDL/src/haptic/linux/SDL_syshaptic.c

Change-Id: Id5607d1d88aa15349e561b0d5397ea3944f08316
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/video/wayland/SDL_waylandvideo.c

index b634867..7399437 100644 (file)
@@ -219,6 +219,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;
     }