wayland_shm: Fix fd leak in dmabuf

Need to close the fd from PrimeHandleToFD.
This commit is contained in:
Derek Foreman 2016-07-25 12:19:43 -05:00
parent b32e1ace46
commit da6b03540f
1 changed files with 2 additions and 0 deletions

View File

@ -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)