derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=da6b03540fbe3e4579084e1e08a93b1612d16f7e

commit da6b03540fbe3e4579084e1e08a93b1612d16f7e
Author: Derek Foreman <der...@osg.samsung.com>
Date:   Mon Jul 25 12:19:43 2016 -0500

    wayland_shm: Fix fd leak in dmabuf
    
    Need to close the fd from PrimeHandleToFD.
---
 src/modules/evas/engines/wayland_shm/evas_dmabuf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c 
b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c
index ed8e1b1..c713b62 100644
--- a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c
+++ b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c
@@ -484,6 +484,7 @@ _evas_dmabuf_buffer_destroy(Dmabuf_Buffer *b)
         b->surface = NULL;
         return;
      }
+   if (b->fd != -1) close(b->fd);
    /* The buffer manager may have been destroyed already if we're
     * doing fallback */
    if (buffer_manager) buffer_manager->discard(b);
@@ -644,6 +645,7 @@ _evas_dmabuf_buffer_init(Dmabuf_Surface *s, int w, int h)
    out = calloc(1, sizeof(Dmabuf_Buffer));
    if (!out) return NULL;
 
+   out->fd = -1;
    out->surface = s;
    out->bh = bm->alloc(bm, "name", w, h, &out->stride, &out->fd);
    if (!out->bh)

-- 


Reply via email to