close fds at the error case 02/85602/2 accepted/tizen/common/20160830.150228 accepted/tizen/ivi/20160830.235640 accepted/tizen/mobile/20160830.235428 accepted/tizen/tv/20160830.235510 accepted/tizen/wearable/20160830.235555 submit/tizen/20160829.120328 submit/tizen/20160830.063644
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 26 Aug 2016 04:59:56 +0000 (13:59 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 26 Aug 2016 07:42:27 +0000 (00:42 -0700)
Change-Id: Ief2496c841071e9e5631df6fee49f8ab20ac5937

src/wayland-tbm-server.c

index 1ea0302..c56ea5c 100644 (file)
@@ -549,7 +549,7 @@ _wayland_tbm_server_impl_create_buffer_with_fd(struct wl_client *client,
        if (numPlane != num_plane) {
                wl_resource_post_error(wl_tbm, WL_TBM_ERROR_INVALID_FORMAT,
                                       "invalid format");
-               return;
+               goto done;
        }
 
        memset(&info, 0x0, sizeof(tbm_surface_info_s));
@@ -595,7 +595,7 @@ _wayland_tbm_server_impl_create_buffer_with_fd(struct wl_client *client,
        if (tbm_buffer == NULL) {
                tbm_surface_destroy(surface);
                wl_resource_post_no_memory(wl_tbm);
-               return;
+               goto done;
        }
 
        snprintf(debug_id, sizeof(debug_id), "%u", (unsigned int)wl_resource_get_id(tbm_buffer->wl_buffer));
@@ -607,6 +607,7 @@ _wayland_tbm_server_impl_create_buffer_with_fd(struct wl_client *client,
        WL_TBM_TRACE("pid:%d tbm_surface:%p\n", pid, surface);
 #endif
 
+done:
        close(buf0);
        close(buf1);
        close(buf2);