screenshot: free screenshot if init failed 67/208567/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Wed, 26 Jun 2019 04:19:44 +0000 (13:19 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Wed, 26 Jun 2019 04:19:48 +0000 (13:19 +0900)
Change-Id: I6c927d0c2b791c118093db98e695990a6c3d6057
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
src/efl_util.c

index a8b882f..65cbb9e 100644 (file)
@@ -2114,6 +2114,8 @@ efl_util_screenshot_initialize(int width, int height)
           {
              set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
              _screenshot_mutex_unlock();
+             if (screenshot)
+                free(screenshot);
              return NULL;
           }
         wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
@@ -2186,6 +2188,8 @@ fail_memory:
    if (display_wrapper)
      wl_proxy_wrapper_destroy(display_wrapper);
    set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
+   if (screenshot)
+     free(screenshot);
    _screenshot_mutex_unlock();
    return NULL;