From c728fb4ff6c3b4fc9eb9b43fcea4a22bc15fd678 Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Tue, 20 Nov 2018 16:07:44 +0800 Subject: [PATCH] Close dmabuf_fd Otherwise it will result in resource leak when failed to create dmabuf memory --- gst/vaapi/gstvaapivideomemory.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c index 3d00e8dd1f..7bacdda2be 100644 --- a/gst/vaapi/gstvaapivideomemory.c +++ b/gst/vaapi/gstvaapivideomemory.c @@ -1060,6 +1060,7 @@ error_create_dmabuf_handle: error_create_dmabuf_memory: { GST_ERROR ("failed to create DMABUF memory"); + close (dmabuf_fd); gst_vaapi_buffer_proxy_unref (dmabuf_proxy); return NULL; }