From bd7b42eb9f182b3eef62a59c9da0ed9f2660440a Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Mon, 6 Jun 2022 00:50:41 -0400 Subject: dmabuf: Don't leak file descriptors on error path --- render/dmabuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'render') diff --git a/render/dmabuf.c b/render/dmabuf.c index 3c431159..433cb82e 100644 --- a/render/dmabuf.c +++ b/render/dmabuf.c @@ -29,7 +29,7 @@ bool wlr_dmabuf_attributes_copy(struct wlr_dmabuf_attributes *dst, error: for (int j = 0; j < i; j++) { - close(dst->fd[i]); + close(dst->fd[j]); dst->fd[j] = -1; } dst->n_planes = 0; -- cgit v1.2.3